如何在MayaVi中绘制正确的3D轴,就像在Matplotlib中找到的轴一样 [英] How to plot proper 3D axes in MayaVi, like those found in Matplotlib

查看:254
本文介绍了如何在MayaVi中绘制正确的3D轴,就像在Matplotlib中找到的轴一样的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何在MayaVi的3D表面图上具有正确的轴。我可以创建的最佳坐标轴看起来像 ...





这些轴看起来比默认的MayaVi轴更加专业,而且更易于阅读。



任何帮助将不胜感激。



谢谢!

解决方案

我也遇到了这个问题。
我通过不显示mayavi轴而改用了一个错误的解决方法,但是使用plot3d()绘制了我需要的轴。pb

 从mayavi导入mlab 
导入numpy为np
xx = yy = zz = np.arange(-0.6,0.7,0.1)
xy = xz = yx = yz = 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()
添加标签和注释,非常优雅和蛮力,但是在紧要关头工作。


I would like to know how to have proper axes on a 3D surface plot in MayaVi. The best axes I could create looked something like this...

However, these do not look very professional if I were to give a presentation or put these on a poster.

I would like the axes to look something like this...

These axes look much more professional and are easier to read than the default MayaVi axes.

Any help would be greatly appreciated.

Thanks!

解决方案

I had this problem too. I hacked a bad workaround by not displaying the mayavi axes, but plotting the axes I needed myself using 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)

You can now add labels and annotations using text3d() Very inelegant and brute force, but works in a pinch.

这篇关于如何在MayaVi中绘制正确的3D轴,就像在Matplotlib中找到的轴一样的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆