On Sun, Feb 20, 2011 at 11:51 AM, Gael Varoquaux <gael.varoqu...@normalesup.org> wrote: > On Sat, Feb 19, 2011 at 10:25:17PM +0000, Michele Mattioni wrote: >> I think I've got the majority of things properly up, however I'm >> trying to figure out how to add the colorbar >> https://gist.github.com/829727#file_example.py > >> I didn't find which object I should pass to the scalarbar function. > > The 'surf' object that you created. Pass it after adding the scalars, at > the end of your script. >
If I add the surf as the last line of the script I get a Segmentation Fault. # Scalars voltage = np.linspace(-90, 60, num=20) combination.point_data.scalars = np.repeat(voltage, 24) # 24 points per cylinder combination.point_data.scalars.name = 'Voltage' surf = mlab.pipeline.surface(combination) Maybe there is a way to add the scalars to the surf, but I really didn't find it. The rest is fixed (can select the individual cylinder and get hold of it, follow the red balls example..) Thanks, Michele ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ MayaVi-users mailing list MayaVi-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mayavi-users