Code: Select all
fn = 'D:/Temp/hysplit/output_850'
f = addfile_hytraj(fn)
tlayer = f.trajlayer()
ls = tlayer.legend()
for lb in ls.getLegendBreaks():
lb.setDrawSymbol(False)
stlayer = f.trajsplayer()
lcountry = shaperead('country')
lchina = shaperead('cn_province')
#Relief data
fn = 'D:/Temp/nc/elev.0.25-deg.nc'
f = addfile(fn)
elev = f['data'][0,'15:40','90:115']
elev[elev<0] = 0
#Plot
ax = axes3dgl()
cols = makecolors(20, cmap='MPL_terrain')
cols[0] = 'gray'
ls = ax.plot_surface(elev, 20, colors=cols, edge=False)
ax.plot_layer(tlayer)
ax.plot_layer(stlayer, fill=False)
ax.plot_layer(lchina, offset=100)
ax.plot_layer(lcountry, edgecolor='k', offset=100)
xlim(90, 115)
ylim(15, 40)
zlim(0, 10000)
xlabel('Longitude')
ylabel('Latitude')
zlabel('Height')
title('3D trajectory example')