如何在 MayaVi 中绘制正确的 3D 轴,就像在 Matplotlib 中找到的那样

问题描述 投票:0回答:1

我想知道如何在 MayaVi 的 3D 曲面图上设置适当的轴。我能创造的最好的轴看起来像this...

enter image description here

但是,如果我要进行演示或将它们放在海报上,这些看起来不太专业。

我希望轴看起来像this...

enter image description here

这些轴看起来比默认的 MayaVi 轴更专业,也更容易阅读。

python plot 3d mayavi
1个回答
9
投票

我也有这个问题。 我通过不显示 mayavi 轴来破解一个糟糕的解决方法,而是使用 plot3d() 绘制我自己需要的轴

from mayavi import mlab
import numpy as np
xx = yy = zz = np.arange(-0.6,0.7,0.1)
xy = xz = yx = yz = zx = zy = np.zeros_like(xx)    
mlab.plot3d(yx,yy+lensoffset,yz,line_width=0.01,tube_radius=0.01)
mlab.plot3d(zx,zy+lensoffset,zz,line_width=0.01,tube_radius=0.01)
mlab.plot3d(xx,xy+lensoffset,xz,line_width=0.01,tube_radius=0.01)

您现在可以使用 text3d() 添加标签和注释 非常不优雅和蛮力,但在紧要关头工作。

© www.soinside.com 2019 - 2024. All rights reserved.