Realtime update of plotted data broken
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 316
- Avg merge
- 7h 44m
- Merged PRs (30d)
- 5
Description
Hi,
Just realised that my old python programs which use mayavi do not update the plotted data any more. I just ran the example program from the mayavi website (http://docs.enthought.com/mayavi/mayavi/mlab.html) and it gave the same result.
Basically the part which does not work as expected is:
for i in range(10):
x = np.cos(mu)_(1+np.cos(n_long_mu/n_mer + np.pi_(i+1)/5.)_0.5)
scalars = np.sin(mu + np.pi*(i+1)/5)
ms.set(x=x, scalars=scalars)
On the other hand the example which uses a callback to update the plot works.
def picker_callback(picker_obj):
picked = picker_obj.actors
if mesh.actor.actor._vtk_obj in [o._vtk_obj for o in picked]:
# m.mlab_source.points is the points array underlying the vtk
# dataset. GetPointId return the index in this array.
x_, y_ = np.lib.index_tricks.unravel_index(picker_obj.point_id,
s.shape)
print("Data indices: %i, %i" % (x_, y_))
n_x, n_y = s.shape
cursor.mlab_source.reset(x=x_ - n_x/2.,
y=y_ - n_y/2.)
cursor3d.mlab_source.reset(x=x[x_, y_],
y=y[x_, y_],
z=z[x_, y_])
fig.on_mouse_pick(picker_callback)
mlab.show()
Mayavi: 4.4.4
vtk: python-vtk 5.8.0-14.1ubuntu3 amd64
Did some one experience the same problem? Is there a workaround?
Thanks,
Thomas
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.