在Matlab中绘制多图形
我正在使用一些matlab代码来处理数据(在卡尔曼滤波器中),并创建一系列等高线图。它已经在Matlab2006a中的RHEL4服务器上运行了几年,但我的老板最近要求将所有服务器更新为RHEL6…至少是Matlab2007a。我已经计算出了这些版本之间的所有折旧,但我仍然有一个主要问题 创建和打印不同等高线图的代码适用于首先创建的三个图中的任何一个。看起来是这样的: 不幸的是,接下来的两个图如下所示: 这三个图形在单独的函数中独立绘制,我使用在Matlab中绘制多图形,matlab,contour,rhel,matlab-figure,Matlab,Contour,Rhel,Matlab Figure,我正在使用一些matlab代码来处理数据(在卡尔曼滤波器中),并创建一系列等高线图。它已经在Matlab2006a中的RHEL4服务器上运行了几年,但我的老板最近要求将所有服务器更新为RHEL6…至少是Matlab2007a。我已经计算出了这些版本之间的所有折旧,但我仍然有一个主要问题 创建和打印不同等高线图的代码适用于首先创建的三个图中的任何一个。看起来是这样的: 不幸的是,接下来的两个图如下所示: 这三个图形在单独的函数中独立绘制,我使用clf(“重置”)在创建每个图形之前和之后。每个函
clf(“重置”)代码>在创建每个图形之前和之后。每个函数本身都工作,但当所有三个图形都绘制出来时,第二个和第三个图形都被弄乱了。还有其他人有这个问题吗?下面是创建其中一个图形的代码
function Crd = TEC_plot(ITEC,RT,Param,Input,t,OutPath,RxExtAll,Time)
% Generate TEC plot
Function_for_Spline_Smoothing = [.05 .1 .05; .1 .4 .1; .05 .1 .05];
ITEC = conv2(ITEC,Function_for_Spline_Smoothing,'same'); % add more of these lines to make contours smoother
ITEC = conv2(ITEC,Function_for_Spline_Smoothing,'same'); % add more of these lines to make contours smoother
% ITEC = conv2(ITEC,Function_for_Spline_Smoothing,'same'); % add more of these lines to make contours smoother
% ITEC = conv2(ITEC,Function_for_Spline_Smoothing,'same'); % add more of these lines to make contours smoother
earth('CAMERA',RT.Camera,'FIG',1);
figure;
warning off; hold on;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Changed 13 February 2007 to make plots prettier
thinning_scale=2; % (1 to 10) increase this value to thin the density of the contour number labels
[cscale,hgt]=m_contour(Param.Grid.LonAxis,Param.Grid.LatAxis,ITEC, ...
round(RT.Levels(1:thinning_scale:end)/5)*5);
hold on
m_contourf(Param.Grid.LonAxis,Param.Grid.LatAxis,ITEC,RT.Levels);
shading flat
m_coast('line','color','y','LineWidth',1);
clabel(cscale,hgt,'labelspacing',72,'rotation',0,'fontsize',10 ...
,'FontAngle','italic','color','w');
axis([-.65 .6 .25 1.32]) % hardwiring axis length since the coastline runs off of the plot
% Changed 13 February 2007
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %-------------------- to include different station markers for different sources -------------------
if ~isempty(Input.Data) % Plot receivers used in this inversion
Crd=uniquerows(double(cat(1,RxExtAll)));
RxType=round(Crd(:,4));
Crd=cartsph(Crd)*180/pi;
i1 = find( (Crd(:,3) > RT.Camera(3)).*(Crd(:,3) < RT.Camera(4)).*...
(Crd(:,2) > RT.Camera(1)).*(Crd(:,2) < RT.Camera(2)).*...
(RxType==1) );
i2 = find( (Crd(:,3) > RT.Camera(3)).*(Crd(:,3) < RT.Camera(4)).*...
(Crd(:,2) > RT.Camera(1)).*(Crd(:,2) < RT.Camera(2)).*...
(RxType==2) );
i3 = find( (Crd(:,3) > RT.Camera(3)).*(Crd(:,3) < RT.Camera(4)).*...
(Crd(:,2) > RT.Camera(1)).*(Crd(:,2) < RT.Camera(2)).*...
(RxType==3) );
m_plot(Crd(i1,3),Crd(i1,2),'ro','markersize',5,'LineWidth',2);
% m_plot(Crd(i1,3),Crd(i1,2),'r.','markersize',6,'LineWidth',2);
m_plot(Crd(i2,3),Crd(i2,2),'r^','markersize',5,'LineWidth',2);
% m_plot(Crd(i2,3),Crd(i2,2),'r.','markersize',6,'LineWidth',2);
m_plot(Crd(i3,3),Crd(i3,2),'rp','markersize',5,'LineWidth',2);
plot(-.6,.45,'ro','markersize',5,'LineWidth',2);text(-.55,.45,'CORS','Color','k')
plot(-.6,.39,'r^','markersize',5,'LineWidth',2);text(-.55,.39,'GPS/Met','Color','k')
plot(-.6,.33,'rp','markersize',5,'LineWidth',2);text(-.55,.33,'RTIGS','Color','k')
end
% % -------------------------------------------------------------------------------
hold off; warning on;axis off;
% caxis([RT.Levels(1),(RT.Levels(length(RT.Levels)))/2]); colorbar('vert'); %Color bar from 0 to 50 --- for Low Solar Activity
caxis([RT.Levels(1),(RT.Levels(length(RT.Levels)))]); colorbar('vert'); %Color bar from 0 to 100 --- for High Solar Activity
title(sprintf('Total Electron Content Units x 10^1^6 m^-^2'),'Fontsize',11)
if size(Crd,1)==0,
title(sprintf('Total Electron Content Units x 10^1^6 m^-^2 Caution: No Data Available, IRI95 Only'),'Fontsize',10)
end
whitebg('w')
text(-0.6,0.22,sprintf('%s from %s to %s UT NOAA/SWPC Boulder, CO USA (op.ver. 1.0)',datestr(Time(t)+1E-8,1),datestr(Time(t)+1E-8,15),datestr(Time(t)+1E-7+15/1440,15)),'Fontsize',11)
whitebg('w')
% This option print to a file
% set(gcf, 'Position', [0,0,1950,1467]);
% print('-f1','-dpng','-painters',filename([OutPath,'{YYYY}{MM}{DD}{HRMN}_TEC'],Time(t)));
% system(['convert ', filename([OutPath,'{YYYY}{MM}{DD}{HRMN}_TEC.png'],Time(t)),' -scale 650x489 ',' -colors 256 ', filename([OutPath,'{YYYY}{MM}{DD}{HRMN}_TEC.png'],Time(t))]);
% Printing a postscript file because requirements for the automatic reboot
print('-f1','-dpsc','-r1000','-painters', filename([OutPath,'{YYYY}{MM}{DD}{HRMN}_TEC'],Time(t)));
% Convert the postscript file to jpg using ghostscripts
system(['gs -q -dBATCH -dNOPAUSE -r300 -sDEVICE=jpeg -sOutputFile=',filename([OutPath,'{YYYY}{MM}{DD}{HRMN}_TEC.jpg'],Time(t)),' ', filename([OutPath,'{YYYY}{MM}{DD}{HRMN}_TEC.ps'],Time(t))]);
% Converting from jpg to png and reducing the size of the figure.
system(['convert ',filename([OutPath,'{YYYY}{MM}{DD}{HRMN}_TEC.jpg'],Time(t)),' -crop 2050x1675+325+775 ',' -scale 650x489 ',' -colors 256 ', filename([OutPath,'{YYYY}{MM}{DD}{HRMN}_TEC.png'],Time(t))]);
% Removing the jpg and ps files (ask Cliff how can we put both files in just one command)
%system(['rm ',filename([OutPath,'*.jpg'],Time(t))]);
%system(['rm ',filename([OutPath,'*.ps'],Time(t))]);
end
函数Crd=TEC_图(ITEC、RT、参数、输入、t、输出路径、RxExtAll、时间)
%生成TEC图
用于样条线平滑的函数=[.05.1.05;.1.4.1;.05.1.05];
ITEC=conv2(ITEC,用于样条曲线平滑的函数,'same');%添加更多这些线以使轮廓更平滑
ITEC=conv2(ITEC,用于样条曲线平滑的函数,'same');%添加更多这些线以使轮廓更平滑
%ITEC=conv2(ITEC,用于样条曲线平滑的函数,'same');%添加更多这些线以使轮廓更平滑
%ITEC=conv2(ITEC,用于样条曲线平滑的函数,'same');%添加更多这些线以使轮廓更平滑
地面(“摄像机”、RT摄像机、“图”、1);
图形
警告关闭;等等
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%2007年2月13日更改,使地块更漂亮
稀释度=2;%(1到10)增加此值以减小轮廓编号标签的密度
[cscale,hgt]=m_等高线(参数网格长轴,参数网格宽轴,ITEC。。。
圆形(RT.Levels(1:thinging_scale:end)/5)*5);
等等
m_contourf(参数网格LonAxis、参数网格LatAxis、ITEC、RT.Levels);
平底色
m_coast('line','color','y','LineWidth',1);
克拉贝尔(cscale,hgt,'labelspacing',72,'rotation',0,'fontsize',10。。。
","方角","斜体","彩色","w",;
轴([-.65.6.25 1.32])%硬接线轴长度,因为海岸线从地块外延伸
%2007年2月13日更改
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%--------------包括不同来源的不同桩号标记-------------------
if~isempty(Input.Data)%Plot此反演中使用的接收器
Crd=uniquerows(双(1类,RxExtAll));
RxType=圆形(Crd(:,4));
Crd=cartsph(Crd)*180/pi;
i1=find((Crd(:,3)>RT.Camera(3)).*(Crd(:,3)RT.Camera(1)).*(Crd(:,2)RT.Camera(3)).*(Crd(:,3)RT.Camera(1)).*(Crd(:,2)RT.Camera(3)).*(Crd(:,3)RT.Camera(1)).*(Crd(:,2)print(gcf,'-dpng','-r1000',filename(...))