Mayavi显示错误的对象扩展名

2024-04-20 10:56:20 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个镶嵌的Aster-GDEM瓷砖,我缝在一起。当我用plt.contourf(mosaic.lon1d, mosaic.lat1d, mosaic.elev, 40, cmap=plt.cm.terrain)绘制数据时,一切都已就绪,并且显示正确。 enter image description here

但是,以下代码:

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


Tags: 数据cmpltcmapfiguremosaic瓷砖mlab
1条回答
网友
1楼 · 发布于 2024-04-20 10:56:20

如果数组值没有增加(lat1d数据在减少),mayavi似乎有问题。在

如果反转lat1d和elev阵列,则得到正确的绘图。在

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

相关问题 更多 >