2014-10-26 122 views
0

我有拼接在一起的Aster GDEM瓷磚的拼圖。當我用plt.contourf(mosaic.lon1d, mosaic.lat1d, mosaic.elev, 40, cmap=plt.cm.terrain)繪製數據時,所有內容都已就位並顯示正確。 enter image description hereMayavi顯示錯誤的對象範圍

然而,下面的代碼:

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) 

產生該圖中,它是除了將緯度從24至29,而不是29至34是這樣它應該在的事實細。 enter image description here

任何想法,爲什麼這是?我可以改變這個嗎?

以下鏈接將下載數據(lat1d, lon1d, elev)作爲.npy文件以numpy.load讀入。 download data zip file: http://goo.gl/nhCNFS

回答

1

似乎mayavi有問題,如果數組值不增加(您的lat1d數據正在減少)。

如果你扭轉你的lat1d和高度數組,你會得到一個正確的圖。

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() 

enter image description here