如何在 mayavi2 中缩放 x 和 y 轴? [英] How do I scale the x and y axes in mayavi2?

查看:144
本文介绍了如何在 mayavi2 中缩放 x 和 y 轴?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 mayavi.mlab.surf() 用 mayavi2 做一个 3-d 绘图.此函数有一个名为 warp_scale 的参数,可用于缩放 z 轴,我正在寻找类似的东西,但用于 x 和 y 轴.

I want to do a 3-d plot with mayavi2 using mayavi.mlab.surf(). This function has an argument called warp_scale that can be used to scale the z axis, I'm looking for something similar but for the x and y axes.

我可以通过将 x 和 y 数组相乘,然后使用 mayavi.mlab.axes() 中的 range 参数来校正轴标签来手动执行此操作,但是我正在寻找一种更直接的方法,例如 warp_scale.

I can do this manually by multiplying the x and y arrays and then using the ranges argument in mayavi.mlab.axes() to correct the axes labels, however I'm looking for a more direct approach like that of warp_scale.

谢谢!

推荐答案

当m"是你的表面对象时:

when "m" is your surface object:

m.actor.actor.scale = (0.1, 1.0, 1.0)

http://osdir.com/ml/python.enthought.devel/2006-11/msg00067.html

这篇关于如何在 mayavi2 中缩放 x 和 y 轴?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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