On Fri 23 Mar 2012 05:55:43 GMT, Gael Varoquaux wrote:
> On Fri, Mar 23, 2012 at 12:39:35AM +0000, Andreas wrote:
>> Right, thanks... how to make the association with the scene though?
>
>> self.plot_edges, self.plot_nodes = m3Dg.plot_graph(<<params>>  )
>
> Rewrite the function so that it takes self.m3Dg as an argument and uses
> m3Dg.mlab instead of mlab inside the function.

I'm afraid I don't understand. "m3Dg" is not an attribute of the GUI 
object that "self" refers to; it simply comes from the line

    import mayavi_3d_graph as m3Dg

where "mayavi_3d_graph.py" is the name of the module where I put the 
"plot_graph()" definition.

If you have

    scene = Instance(MlabSceneModel, ())

then when doing

   self.scene.mlab.plot3d()

I suppose "mlab.plot3d()" works courtesy of "Instance". But "Instance" 
knows nothing about "m3Dg.plot_graph()".

Does that clarify my confusion? Thanks,

Andreas

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
MayaVi-users mailing list
MayaVi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mayavi-users

Reply via email to