admin 管理员组文章数量: 887021
2024年2月25日发(作者:advertisements)
A=[1.486,3.059,0.1;2.121,4.041,0.1;2.570,3.959,0.1;3.439,4.396,0.1;
4.505,3.012,0.1;3.402,1.604,0.1;2.570,2.065,0.1;2.150,1.970,0.1;
1.794,3.059,0.2;2.121,3.615,0.2;2.570,3.473,0.2;3.421,4.160,0.2;
4.271,3.036,0.2;3.411,1.876,0.2;2.561,2.562,0.2;2.179,2.420,0.2;
2.757,3.024,0.3;3.439,3.970,0.3;4.084,3.036,0.3;3.402,2.077,0.3;
2.879,3.036,0.4;3.421,3.793,0.4;3.953,3.036,0.4;3.402,2.219,0.4;
3.000,3.047,0.5;3.430,3.639,0.5;3.822,3.012,0.5;3.411,2.385,0.5;
3.103,3.012,0.6;3.430,3.462,0.6;3.710,3.036,0.6;3.402,2.562,0.6;
3.224,3.047,0.7;3.411,3.260,0.7;3.542,3.024,0.7;3.393,2.763,0.7];
x=A(:,1);y=A(:,2);z=A(:,3);
scatter(x,y,5,z)%散点图
figure
[X,Y,Z]=griddata(x,y,z,linspace(1.486,4.271)',linspace(1.604,4.276),'v4');%插值
pcolor(X,Y,Z);shading interp%伪彩色图
figure,contourf(X,Y,Z) %等高线图
x=xlsread('C:Documents and SettingsAdministrator桌面cumcm2011A附件_数据.xls',1,'B4:B322');
y=xlsread('C:Documents and SettingsAdministrator桌面cumcm2011A附件_数据.xls',1,'C4:C322');
z=xlsread('C:Documents and SettingsAdministrator桌面cumcm2011A附件_数据.xls',2,'I4:I322');
[X,Y,Z]=griddata(x,y,z,linspace(0,28654)',linspace(0,18449),'v4');%插值
subplot(1,2,1),contourf(X,Y,Z) %等高线图
tri=delaunay(x,y);
subplot(1,2,2),trisurf(tri,x,y,z) %空间立体图
xlabel('x')
ylabel('y')
zlabel('元素Zn的含量')
title('元素Zn在整个城市的空间分布')
x=xlsread('C:Documents and SettingsAdministrator桌面cumcm2011A附件_数据.xls',1,'B4:B322');
y=xlsread('C:Documents and SettingsAdministrator桌面cumcm2011A附件_数据.xls',1,'C4:C322');
z=xlsread('C:Documents and SettingsAdministrator桌面cumcm2011A附件_数据.xls',1,'D4:D322');
[X,Y,Z]=griddata(x,y,z,linspace(0,28654)',linspace(0,18449),'v4'); %插值
[C,h] = contour(X,Y,Z);
clabel(C,h);
xlabel('x/m')
ylabel('y/m')
zlabel('海拔高度')
title('城市地貌等高线图')
x=xlsread('C:Documents and SettingsAdministrator桌面cumcm2011A附件_数据.xls',1,'B4:B322');
y=xlsread('C:Documents and SettingsAdministrator桌面cumcm2011A附件_数据.xls',1,'C4:C322');
z=xlsread('C:Documents and SettingsAdministrator桌面cumcm2011A附件_数据.xls',2,'B4:B322');
[X,Y,Z]=griddata(x,y,z,linspace(0,28654)',linspace(0,18449),'v4'); %插值
[C,h] = contour(X,Y,Z);
clabel(C,h);
% axis([xmin xmax ymin ymax])
% subplot(1,2,1),
%contour(X,Y,Z) %等高线图
% subplot(1,2,1),
%[C,h]=contour(interp2(Z,4)) %等高线图
%text_handle=clabel(C,h)
%set(text_handle,'backgroundColor',[1 1 .6],...'EdgeColor',[.7 .7 .7])
% subplot(1,2,2),
%surf(Z)
% tri=delaunay(x,y);
% subplot(1,2,2),trisurf(tri,x,y,z) %空间立体图
xlabel('x/m')
ylabel('y/m')
%zlabel('元素As的含量()')
title('元素As在该城区的空间分布')
版权声明:本文标题:matlab中如何根据散点画出等高线 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.freenas.com.cn/free/1708858732h532937.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论