In [1]: from __future__ import division
In [2]: from mayavi import mlab
In [3]: from numpy import pi, sin, cos, mgrid, ogrid
In [4]: [u1,v1] = ogrid[0:8:5j,0:2*pi:5j]
In [5]: [t3,t4] = ogrid[1:1:5j,1:1:5j]
In [6]: x = u1 * sin(v1)
In [7]: y = u1 * cos(v1)
In [8]: z = 5 * t3 * t4
In [9]: mlab.plot3d(x,y,z)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
/home/lblasc/<ipython-input-11-783c3fe02c12> in <module>()
----> 1 mlab.plot3d(x,y,z)
/usr/lib/python2.7/dist-packages/mayavi/tools/helper_functions.pyc in the_function(*args, **kwargs)
32 def document_pipeline(pipeline):
33 def the_function(*args, **kwargs):
---> 34 return pipeline(*args, **kwargs)
35
36 if hasattr(pipeline, 'doc'):
/usr/lib/python2.7/dist-packages/mayavi/tools/helper_functions.pyc in __call__(self, *args, **kwargs)
77 scene.disable_render = True
78 # Then call the real logic
---> 79 output = self.__call_internal__(*args, **kwargs)
80 # And re-enable the rendering, if needed.
81 if scene is not None:
/usr/lib/python2.7/dist-packages/mayavi/tools/helper_functions.pyc in __call_internal__(self, *args, **kwargs)
534 filters.
535 """
--> 536 self.source = self._source_function(*args, **kwargs)
537 kwargs.pop('name', None)
538 self.store_kwargs(kwargs)
/usr/lib/python2.7/dist-packages/mayavi/tools/sources.pyc in line_source(*args, **kwargs)
1169
1170 data_source = MLineSource()
-> 1171 data_source.reset(x=x, y=y, z=z, scalars=s)
1172
1173 name = kwargs.pop('name', 'LineSource')
/usr/lib/python2.7/dist-packages/mayavi/tools/sources.pyc in reset(self, **traits)
489 else:
490 points = np.c_[x.ravel(), y.ravel(), z.ravel()].ravel()
--> 491 points.shape = (len(x), 3)
492 self.set(points=points, trait_change_notify=False)
493
ValueError: total size of new array must be unchanged