How can I change the distance between figures in subplot?

조회 수: 17 (최근 30일)
Szabó-Takács Beáta
Szabó-Takács Beáta 2016년 2월 3일
편집: Ingrid 2016년 2월 3일
Dear All,
I created a subplot figure with the following code:
subplot(2,2,1);
axesm('lambert','maplatlimit',[ 26.5861 71.8699],'maplonlimit',[-34.748 60.8422]);
>> pcolorm(lat,lon,IU1);
set(gca,'box','off')
set(gca,'visible','off')
set(gcf,'resize','on');
>> colormap(C);
subplot(2,2,2);
axesm('lambert','maplatlimit',[ 26.5861 71.8699],'maplonlimit',[-34.748 60.8422]);
>> pcolorm(lat,lon,IU2);
set(gca,'box','off')
set(gca,'visible','off')
set(gcf,'resize','on');
>> colormap(C);
subplot(2,2,3);
axesm('lambert','maplatlimit',[ 26.5861 71.8699],'maplonlimit',[-34.748 60.8422]);
>> pcolorm(lat,lon,IU3);
set(gca,'box','off')
set(gca,'visible','off')
set(gcf,'resize','on');
>> colormap(C);
subplot(2,2,4);
axesm('lambert','maplatlimit',[ 26.5861 71.8699],'maplonlimit',[-34.748 60.8422]);
>> pcolorm(lat,lon,IU4);
set(gca,'box','off')
set(gca,'visible','off')
set(gcf,'resize','on');
>> colormap(C);
hp4 = get(subplot(2,2,4),'Position')
>> h=colorbar;
set(h, 'Position', [hp4(1)+hp4(3)+0.02 hp4(2) 0.01 hp4(2)+hp4(3)*2.1],'YTickMode', 'manual', 'YTick',[1,2,3,4,5], 'YTickLabelMode', 'manual', 'YTickLabel', {'Hiper-arid', 'Arid', 'Semi-arid', 'Sub-humid', 'Humid'},'FontSize',12, 'FontWeight', 'bold');
I delted the box with
set(gca,'box','off')
because the Lambert projection created a too big box compare to the figure. In the resulted figure (is attached)the distance between subplot(2,2,1) and subplot(2,2,2) is too large. Could someone suggest me a solution for mitigate the distance? Thank you for your help in advance!

답변 (1개)

Ingrid
Ingrid 2016년 2월 3일
편집: Ingrid 2016년 2월 3일
is use this submission from the file exchange
but there are many others there that can do what you want, just search for subpot in the file exchange and read the short description to see which one best fits your needs

카테고리

Help CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by