clc;clear;
data1=xlsread('1998tmp.xlsx');
aa1=xlsread('AAA1.xlsx');
aa2=xlsread('AAA2.xlsx');
aa3=xlsread('AAA3.xlsx');
aa4=xlsread('AAA4.xlsx');
aa5=xlsread('AAA5.xlsx');
aa6=xlsread('AAA6.xlsx');
aa9=xlsread('AAA9.xlsx');
A1=data1(:,1);a1=A1(2:end);
B1=data1(1,:);B1=B1';b1=B1(2:end);
figure('numbertitle','off','name','contour3');
A=[aa1,aa2,aa3,aa4,aa5,aa6,aa9];
for i=1:1:7;
clf;
a=A(:,[(i-1)*41+1:i*41]);
contour3(b1,a1,a,50, 'LineWidth',1.2);hold on
colormap('jet');view(0,90);colorbar;
str=get(gca,'xticklabel'); %获得句柄值
strtxt=strcat(str,'°N'); %字符串上加上°N’
set(gca,'xticklabel',strtxt); %重新设定横坐标%
str=get(gca,'yticklabel'); %获得句柄值
strtxt=strcat(str,'°E'); %字符串上加上°E’
set(gca,'yticklabel',strtxt); %重新设定横坐标%
% 坐标轴美化
axis equal;set(gca, 'Box', 'off', 'LineWidth', 1,...
'XGrid', 'off', 'YGrid', 'off', ...
'TickDir', 'in', 'TickLength', [.015 .015], ...
'XMinorTick', 'on', 'YMinorTick', 'on', ...
'XColor', [.1 .1 .1], 'YColor',[.1 .1 .1]);
hold on;set(gca,'XAxisLocation','top')
XL = get(gca,'xlim'); XR = XL(2);
YL = get(gca,'ylim');YT = YL(2);
xc = get(gca,'XColor');yc = get(gca,'YColor');
plot(XL,20*ones(size(XL)),'color',xc,'LineWidth',1);
plot(XR*ones(size(YL)),YL,'color',yc,'LineWidth',1);
set(gca, 'FontSize', 10);set(gcf,'Color',[1 1 1]);
box on;grid on;
pause(0.1);%加坐标边框%加网格线%可以在这里添加输出动图的程序
print(['Frame ' num2str(i)], '-dpng', '-r150');
drawnow;%实时更新坐标图窗口
end
colormap('jet');
GifName = '温度图.gif';
delay = 0.5; % Delay between frames (s)
for ii = 1:1:7;
[A, ~] = imread(['Frame ' num2str(ii) '.png']);
[X, map] = rgb2ind(A, 256);
if ii == 1
imwrite(X, map, GifName, 'gif', 'LoopCount', inf, 'DelayTime', delay)
else
imwrite(X, map, GifName, 'gif', 'WriteMode', 'append', 'DelayTime', delay)
end
end
经纬度下温度变化
最新推荐文章于 2024-07-23 19:30:21 发布