![matlab subplot子图调整位置后,坐标轴label发生了重叠,该怎么办?]()
matlab画图代码:
% function []=RSEFig14_else()
warning off;
format long;
Name=strcat('RSEFig14_else');
left=500;
bottom=150;
width=600;
height=800;
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% % % % % sardir='F:\RSECODE2017\RSECODE2017\data1zhangxi\rs2imageszhangxi\';
newdir='F:\RSECODE2017\RSECODE2017\data1zhangxi\rs2imageszhangxi\RSEfig12_15_results\';
f12dir='F:\RSECODE2017\RSECODE2017\data1zhangxi\rs2imageszhangxi\plotfig12_15\';
ptm='nwflagD';
sear=strcat(f12dir,'*',ptm,'*');
tem=ls(sear);
si=size(tem);
NN=si(1);
% % % % % % % % % % % % % % % % % % % % % % % % % %
ptm1='gdLatmatrix_wholeimage';
sear1=strcat(newdir,'*',ptm1,'*');
tem1=ls(sear1);
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% testRSE;
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
h=figure('Name',Name); set(gcf,'color','w'); %
set(h,'Position',[left bottom width height]);
pos=[0.09 0.71 0.36 0.275;
0.6 0.71 0.36 0.275;
0.09 0.39 0.36 0.275;
0.6 0.39 0.36 0.275;
0.09 0.07 0.36 0.275;
0.6 0.07 0.36 0.275];
for i=1:1%NN
i
pterm=tem(i, ;
pterm1=tem1(i, ;
w=strcat(f12dir,pterm);
nwflag=dlmread(w);
w=strcat(newdir,pterm1);
w0=strrep(w,ptm,'gdLatmatrix_wholeimage');
gdLat=dlmread(w0);
w0=strrep(w,ptm,'gdLongmatrix_wholeimage');
gdLon=dlmread(w0);
hh=subplot('Position',pos(i, );
latmin0=min(min(gdLat));
latmax0=max(max(gdLat));
longmin0=min(min(gdLon));
longmax0=max(max(gdLon));
m_proj('lambert','lat',[latmin0 latmax0],'lon',[longmin0 longmax0],'aspect');%,'position',[0.1 0.1 0.9 0.9 ]);%
hold on;
m_coast('patch',[1 .85 .7]);%%,'edgecolor','r');
m_pcolor(gdLon,gdLat,nwflag);hold on;colormap('gray');%caxis([-30,0]);
shading flat;
hold on;
hb=colorbar('fontsize',8,'FontName','Arial');
set(get(hb,'ylabel'),'string','','fontsize',8,'FontName','Arial');
m_grid( 'box','fancy','tickdir','in','Yaxislocation','left','FontName','Arial',...
'Xaxislocation','bottom','ylabeldir','end','ticklength',.02,'linest','none','fontsize',8);%);
xlabel('Longitude ( ^° )','fontsize',8);
ylabel('Latitude ( ^° )','fontsize',8,'rotation',90);
end |