How can I change the distance between figures in subplot?
조회 수: 20 (최근 30일)
이전 댓글 표시
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!
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Subplots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!