On Mon, Nov 30, 2009 at 12:47 PM, Gael Varoquaux
<[email protected]> wrote:

> So, here is the way I would do it:
>
> ################################################################################
> from enthought.mayavi import mlab
>
> import numpy as np
>
> x, y, z = np.ogrid[-3:3:31j, -3:3:31j, -3:3:31j]
>
> r = np.sqrt(x**2 + y**2 + z**2)
>
> mlab.clf()
> sf = mlab.pipeline.scalar_field(r)
>
> ipw = mlab.pipeline.image_plane_widget(sf)
> sf.mlab_source.scalars = np.sin(r)
>
> mlab.show()
> ################################################################################
>
> See
> http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/mlab.html#animating-the-data
>

I am using mlab (following the lead of most of the code examples). So
just to be clear, you're suggesting accessing the "scalars" attribute
directly, instead of using set() or reset(). This works!

If I did have to use set, it looks like I can use the keyword arg
"trait_change_notify=True". Or I can follow up by calling update() on
the MArraySource, correct?

Thanks Gael

Mike

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
MayaVi-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mayavi-users

Reply via email to