- 积分
- 73
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-4-24
- 最后登录
- 1970-1-1
|
发表于 2020-7-10 09:49:22
|
显示全部楼层
王老师您好,我在画等值线图,但是画出来效果不如Grads简洁,数据已经经过9点平滑,看起来还是有些啰嗦,线条也没有Grads好看(见附件图),想请问王老师如何解决,在此谢过!还有就是等值线label的时候有没有选项说我必须强制标注,或者选择性标注?谢谢!
使用脚本如下:
#Set data folders
#basedir = 'G:\MeteoInfo_2.2.6\mapdata(1)\'
#mapdir = os.path.join(basedir, 'mapdata')
mapdir = 'G:\MeteoInfo_2.2.6\mapdata(1)\mapdata'
#Read shape files
f = addfile('G:/MeteoInfo_2.2.6/nc/temjjadif.nc', 'r')
lai = f['tem']
data=lai[:,:]
f1 = addfile('G:/MeteoInfo_2.2.6/nc/t2difsm.nc', 'r')
lai1 = f1['a']
data1=lai1[:,:]
bou2_layer = shaperead(os.path.join(mapdir, 'China_land.shp'))
bou1_layer = shaperead(os.path.join(mapdir, 'Other_land.shp'))
river_layer = shaperead(os.path.join(mapdir, 'river.shp'))
sea_layer = shaperead(os.path.join(mapdir, 'sea_line.shp'))
ten_layer = shaperead(os.path.join(mapdir, 'tenline.shp'))
#Plot
proj1 = projinfo(proj='lcc', lon_0=105, lat_1=25, lat_2=47)
axesm(projinfo=proj1, axison=True, tickfontsize=12, topaxis=True)
geoshow(bou2_layer, edgecolor='black')
geoshow(bou1_layer, edgecolor='black')
geoshow(ten_layer, edgecolor='black')
geoshow(sea_layer, facecolor=(0,160,255),size=0.5)
#geoshow(river_layer, facecolor=(0,0,255),size=0.5)
#axis([90,125,20,54])
levs=[-1.0,-0.8,-0.6,-0.4,-0.2,0.2,0.4,0.6,0.8,1.0]
col=[(51,0,102),(51,0,204),(51,51,255),(51,102,255),(102,204,255),(255,255,255),(255,204,0),(255,153,0),(255,102,0),(255,51,51),(180,0,0)]
layer = imshowm(data,levs,colors=col,)
tick=[-1,-0.8,-0.6,-0.4,-0.2,0.2,0.4,0.6,0.8,1]
colorbar(layer, aspect=20, orientation='horizontal', extendrect=False,ticks=tick)
z1=data1
z2=data1
z1[z1>-0.15] = nan
levs1 = [-0.6,-0.2]
col=['black','black','black']
layer1 = contourm(z1,levs1,colors=col,linestyle=':',linewidth=1)
clabel(layer1,fontsize=8)
axism([90, 125, 20, 54])
savefig("D://t2obs.jpg",dpi=300)
|
-
Grads结果
-
Meteoinfo结果
-
-
t2difsm.nc
2.97 MB, 下载次数: 1, 下载积分: 金钱 -5
smooth后的数据
|