How to update a mayavi plot at arbitrary times

16 Views Asked by At

To update plots dynamically, Mayavi uses either generators via mlab.animate() as in this example from the docs or via rather complicated traits as in this other example from the docs.

The solution provided by mlab.animate() is simple and neat, but it steals control from the user: updates occurs at regular time intervals. I would like to retain control of the workflow by calling an 'update plot' method within my own loop or after a certain condition of my own is met (without embedding these loops or if conditions within the function called by animate...)

Is there a simple solution that avoids defining classes deriving from HasTraits etc.?

There was a similar question here but the accepted answer no longer works with new versions of mayavi.

I would even be interested in a solution with traits, which would update a plot when a traits.api parameter is changed programmatically (rather than via the dialog).

0

There are 0 best solutions below