Reputation: 886
I have a mosaic of Aster GDEM tiles which I have stitched together. When I plot the data with plt.contourf(mosaic.lon1d, mosaic.lat1d, mosaic.elev, 40, cmap=plt.cm.terrain)
everything is in place and is shown correctly.
However, the following code:
fig = mlab.figure(figure='ICVM', bgcolor=(1,1,1), fgcolor=(0,0,0), size=(1024,786))
mlab.clf()
topo = mlab.surf(mosaic.lat1d, mosaic.lon1d, mosaic.elev, colormap='gist_earth', warp_scale=-1e-4)
mlab.axes(xlabel='lat.', ylabel='lon.')
mlab.outline()
mlab.view(-160, 125, 10, array([26.5,35.,-0.1168]))
mlab.roll(-90)
produces this plot, which is fine except for the the fact that the latitude goes from 24 to 29 instead of 29 to 34 like it should.
any ideas why that is? can I change this?
the following link will download the data (lat1d, lon1d, elev
) as .npy
file to be read in with numpy.load
.
download data zip file: http://goo.gl/nhCNFS
Upvotes: 0
Views: 526
Reputation: 20821
It seems that mayavi has problems if the array values are not increasing (Your lat1d data is decreasing).
If you reverse your lat1d and elev array you get a correct plot.
fig = mlab.figure(figure='ICVM', bgcolor=(1,1,1), fgcolor=(0,0,0), size=(1024,786))
mlab.clf()
topo = mlab.surf(lat1d[::-1], lon1d, elev[::-1], colormap='gist_earth', warp_scale=-1e-4)
mlab.axes(xlabel='lat.', ylabel='lon.')
mlab.outline()
Upvotes: 1