How does one plot an irregular rectangular mesh with Mayavi in Python
(mayavi.mlab)?
----
from mayavi import mlab
import numpy as np
x = np.array([1, 2, 4])
y = np.array([1, 2, 4])
z = np.array([[3, 3, 3], [4, 4, 4], [3, 3, 3]])
xgrid, ygrid = np.meshgrid(x, y, indexing='xy')
fig = mlab.figure(bgcolor=(1, 1, 1), fgcolor=(0, 0, 0))
s = mlab.pipeline.grid_source(xgrid, ygrid, z)
surf = mlab.pipeline.surface(s, representation='wireframe')
mlab.axes()
mlab.show()
----
The above code plots the mesh with the grid rectangles split into triangles.
I understand why this is needed to plot a 3D surface. But I would like to plot
the rectangular grid without diagonals.
I would also be interested to know if there is a better way to do this with
array2d_source as the documentation suggests it is suitable for non-uniformly
spaced
data<http://docs.enthought.com/mayavi/mayavi/auto/mlab_pipeline_sources.html#array2d-source>.
Simply replacing the call to grid_source with array2d_source does not produce
the same results. What am I missing?
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
MayaVi-users mailing list
MayaVi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mayavi-users