1
我正在使用Mayavi/mlab創建surf()圖,但由於間距不太好,重新調整的圖片並不令人滿意。這是我的代碼:在Mayavi中更改間距
import pygrib
from mayavi.mlab import *
from mayavi import mlab
grbs = pygrib.open("lfff00000000c_1h.grb")
data = grbs.select(name='Geometric Height of the earths surface above sea level')[0].values
# --> data is a simple 2D array
mlab.figure(1, fgcolor=(0,0,0), bgcolor=(1,1,1))
s = surf(data, colormap='gist_earth')
mlab.title("geom. height", size = 0.5)
所以實際上我想增加結果圖片中x和y軸的間距。但我不知道該怎麼做。我知道,我不知何故必須在Python代碼中使用array_source.spacing = array([5.,5.,1.]),但我不知道如何? :(