- 积分
- 1491
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2019-3-1
- 最后登录
- 1970-1-1
![[用户6506837204] 粉丝数:3 微博数:4 新浪微博达人勋](source/plugin/sina_login/img/light.png)
|
MATLAB
问题截图: |
|
问题概况: |
matlab绘图只出现两种颜色,设置了色标区间也是这样,但是用grads可以绘出正常的图 |
我看过提问的智慧: |
看过 |
自己思考时长(天): |
1 |
系统平台: |
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
数据是用的cpc格点资料,是2018年全球的最高温度
我的脚本
ncid = netcdf.open('D:\ZiLiao\tmax.2018.nc','NOWRITE');
data1 = shaperead('D:\Matlab\shuju\bou1_4m\bou1_4l.shp');
data2 = shaperead('D:\Matlab\shuju\bou2_4m\bou2_4l.shp');
tmax = ncread('D:\ZiLiao\tmax.2018.nc','tmax');
tmax(tmax==-999) = nan; tmax(tmax==0) = nan;
TimeData = ncread('D:\ZiLiao\tmax.2018.nc','time');
londata = ncread('D:\ZiLiao\tmax.2018.nc','lon');
latdata = ncread('D:\ZiLiao\tmax.2018.nc','lat');
figure('Position',[50 50 800 600],'Color',[1 1 1])
axis([70 150 0 90]);box on
[X, Y] = meshgrid(latdata,londata);%全球的地图
[m,n]=meshgrid(londata(140:0.5:300),latdata(0:0.5:180));%北半球的中国板块
tmax2=tmax(:,:,2);
tmax3=tmax(140:0.5:300,0:0.5:180,2);%其中2代表时间
contourf(m,n,tmax3');
colorbar('location','eastoutside');
caxis([-5,20]);
geoshow(data1,'Color','k','LineWidth',1);hold on
geoshow(data2,'Color','k','LineWidth',1);
|
|