matlab绘图
2019-05-21 本文已影响0人
Aerosols
画连续的填色图
% f1 = 'E:\学业\rz\bsc\absc532.csv';
% bk(:,:,1)=xlsread(f1,'absc532','B2:OK11521');
%
% f2 = 'E:\学业\rz\bsc\absc1064.csv';
% bk(:,:,2)=xlsread(f2,'absc1064','B2:OK11521');
%
% bk(bk==-999)=nan;
% bk(bk<0)=0;
%
% H=linspace(6,2400,400);%%%300米是第50个
%
na = datenum(2018,8,30,0,0,0):datenum(0,0,1,0,0,0):datenum(2018,12,27,0,0,0);
name = datenum(2018,8,30,0,0,0):datenum(0,0,1,0,0,0):datenum(2018,12,27,0,0,0);
formatOut = 'yyyy/mm/dd';
name = datestr(name,formatOut);
name2=cellstr(name);
na=cellstr(datestr(na,'yyyy-mm-dd'));
% %%%%% 绘图 %%%%%
% xt=linspace(0,96,25)+1;
%
% cmap = load('E:\学业\cmap.txt');
% cmap = reshape(cmap,[4 188]);
% cmap = cmap';
% t1=cmap;
% clear cmap
% cmap = t1(20:188,:);
%
% yinter=0.06;
% lenh=0.4;
%
% Sx = 0.07;
% Sy = [0.08+yinter+lenh 0.08];
for i=1:32 %其他全是空
hp=figure;
set(hp,'position',[80 100 900 950],'color','w')
set(hp,'visible','off');
for j=1:2
pos = [Sx Sy(j) 0.84 0.4];
subplot('Position',pos)
[~,h1] =contourf(squeeze(bk(1+(i-1)*96:96*i,50:400,j))',300);
set(h1,'LineColor','none')
box off
colormap(cmap(:,1:3));
caxis([0 0.5])
set(gca,'ytick',[35 118 201 285 351],'yticklabel',{'0.5','1','1.5','2','2.4'},'fontsize',10,'fontname','Times new roman')
xlim([1 96])
set(gca,'xtick',xt,'xticklabel',{'00','','','','','','06','','','','','','12','','','','','','18','','','','','','00'},'fontsize',10,'fontname','Times new roman')
ylabel(['\fontsize{15}\fontname{Times new roman}Height/km'])
set(gca,'fontsize',15)
% set(gca,'XMinorTick','on')
if j==1
title(name2{i},'fontsize',20)
text(4,335,'backscattering coefficient','fontsize',20,'fontname','Times new roman','color','w')
text(88,335,'532','fontsize',20,'fontname','Times new roman','color','w')
% caxis([0 0.5])
else
title('')
text(88,335,'1064','fontsize',20,'fontname','Times new roman','color','w')
% caxis([0 2])
end
hc1=colorbar('Position',[Sx+0.85+0.001 Sy(j) 0.02 0.4]);
set(get(hc1,'title'),'string','','fontname','Times new roman','fontsize',14)
end
print('-r150','-dpng',['E:\学业\rz\bsc\',na{i}])
end