python - Mayavi contour3d 文档提到 "the arrows"时是什么意思?

标签 python mayavi

我了解如何在 mayavi 中绘制数据网格的轮廓,如下所示:

from mayavi import mlab
mlab.contour3d(my_data_grid)

但是,我很好奇该函数的其他签名是什么:

mlab.contour3d(x, y, z, my_data_grid)

docs说:

If 4 arrays, (x, y, z, scalars) are passed, the 3 first arrays give the position of the arrows, and the last the scalar value.

什么是“箭头”?我还没有找到任何示例,当我尝试用我的数据集调用它时出现段错误,因此无法测试。

编辑:现在我明白了 mlab 期望 x、y 和 z 的格式,并且我能够让它工作。然而,并没有箭矢!我假设这是文档中的错误...

最佳答案

与其说是文档中的错误,不如说是描述功能的一种看似别扭的方式。来自同一个文档,contour3d:

Plots iso-surfaces for a 3D volume of data supplied as arguments

据说(加粗我的):

The x, y and z arrays are then supposed to have been generated by numpy.mgrid, in other words, they are 3D arrays, with positions lying on a 3D orthogonal and regularly spaced grid with nearest neighbor in space matching nearest neighbor in the array. The function builds a scalar field assuming the points are regularly spaced.

“箭头”似乎有点笨拙,表示 xyz 是 `

3D arrays, with positions lying on a 3D orthogonal and regularly spaced grid

具有“构建标量场”作为等值面的功能,有效地“连接点(位置)”。

关于python - Mayavi contour3d 文档提到 "the arrows"时是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31596024/

相关文章:

python - 如何在 Python Mayavi 中画线?

python - 我可以使字典可用于多个 python 脚本吗?

javascript - 在 web2py 中将 python 数据传递给 javascript

python - 从 Python 运行 TCL 代码

python - 在 Windows 上安装 MayaVi,使用 Python 2.7

python - 如何使用 matplotlib 在 python 中绘制 3D 密度图

Python If/Else 只按顺序返回,不按逻辑

python - 在 jinja2 模板中创建指向 Flask 应用程序 url 的链接

python : plotting a wireframe 3D cuboid

python-2.7 - Mayavi:从选择器对象获取数组索引