Re: [Matplotlib-users] problem in plotting cylinders with differnet colour

2012-02-15 Thread Benjamin Root
On Wed, Feb 15, 2012 at 3:57 PM, Mark Lawrence wrote:

> On 15/02/2012 21:34, Benjamin Root wrote:
> > On Wed, Feb 15, 2012 at 2:52 PM, Mark Lawrence >wrote:
> >
> >> On 15/02/2012 17:21, Benjamin Root wrote:
> >>> On Tue, Feb 14, 2012 at 8:58 AM, Mark Lawrence >>> wrote:
> >>>
>  On 14/02/2012 13:52, Debashish Saha wrote:
> > import numpy
> >
> > from enthought.mayavi import mlab
> >
> > #def test_mesh():
> > #"""A very pretty picture of spherical harmonics translated from
> >
> > #the octaviz example."""
> > for r in range (1,5):
> >   print r
> >
> >
> >   pi = numpy.pi
> >
> >   cos = numpy.cos
> >
> >   sin = numpy.sin
> >
> >   dphi, dtheta, dz = pi/250.0, pi/250.0, 0.01
> >
> >   #[phi,theta] =
>  numpy.mgrid[0:pi+dphi*1.5:dphi,0:2*pi+dtheta*1.5:dtheta]
> >   [phi,z] = numpy.mgrid[0:2*pi+dphi*1.5:dphi,0:2+dz*1.5:dz]
> >
> >   m0 = 4; m1 = 3; m2 = 2; m3 = 3; m4 = 6; m5 = 2; m6 = 6; m7 = 4;
> >
> >  # r = sin(m0*phi)**m1 + cos(m2*phi)**m3 + 5*sin(m4*theta)**m5 +
> > cos(m6*theta)**m7
> >
> >   #x = 1*sin(phi)*cos(theta)
> >
> >   #y = 1*sin(phi)*sin(theta)
> >
> >   #z = 1*cos(phi);
> >   x=r*cos(phi)
> >   y=r*sin(phi)
> >   z=z
> >   i=['Reds','greens','autumn','purples']
> >   print i[r-1]
> >   e=i[r-1]
> >
> >   mlab.mesh(x, y, z,colormap='e')
> >   #print i[r-1]
> >
> > Error:
> > TypeError Traceback (most recent call
>  last)
> > C:\Python27\lib\site-packages\IPython\utils\py3compat.pyc in
> > execfile(fname, glob, loc)
> >   166 else:
> >   167 filename = fname
> > -->168 exec compile(scripttext, filename, 'exec') in
> >> glob,
>  loc
> >   169 else:
> >   170 def execfile(fname, *where):
> >
> > C:\Users\as\jhgf.py in()
> >24 print i[r-1]
> >25 e=i[r-1]
> > --->26 mlab.mesh(x, y, z,'e')
> >27 #print i[r-1]
> >
> >28
> >
> > C:\Python27\lib\site-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'):
> >
> > C:\Python27\lib\site-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:
> >
> > C:\Python27\lib\site-packages\mayavi\tools\helper_functions.pyc in
> > __call_internal__(self, *args, **kwargs)
> >   830 filters.
> >   831 """
> > -->832 self.source = self._source_function(*args,
> **kwargs)
> >   833 kwargs.pop('name', None)
> >   834 self.store_kwargs(kwargs)
> >
> > TypeError: grid_source() takes exactly 3 arguments (4 given)
> >
> >
> 
> >>
> --
> > Keep Your Developer Skills Current with LearnDevNow!
> > The most comprehensive online learning library for Microsoft
> developers
> > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3,
> >> MVC3,
> > Metro Style Apps, more. Free future releases when you subscribe now!
> > http://p.sf.net/sfu/learndevnow-d2d
> 
>  Didn't this get answered on the python tutor mailing list within the
>  last couple of hours?  What's with it with you?
> 
>  --
>  Cheers.
> 
>  Mark Lawrence.
> 
> 
> >>> A couple of things I would like to point out here:
> >>>
> >>> 1.) It is possible that Debashish sent similar questions to multiple
> >>> mailing lists in the hopes to maximize the chance of getting a
> response.
> >>> It may only "appear" that this thread was started after having the
> >> question
> >>> answered on another mailing list because of the delays that are
> notorious
> >>> on this list.  I suspect he sent both emails at around the same time,
> but
> >>> the python tutors list processed it faster than the matplotlib-users
> >> list.
> >>>
> >>> Therefore...
> >>>
> >>> 2.) I would like to make sure that this mailing list remains a
> welcoming
> >>> forum for all users, and for all of us to understand that people have
> >>> different mailing habits that we may not be familiar with.  Theref

Re: [Matplotlib-users] problem in plotting cylinders with differnet colour

2012-02-15 Thread Mark Lawrence
On 15/02/2012 21:34, Benjamin Root wrote:
> On Wed, Feb 15, 2012 at 2:52 PM, Mark Lawrencewrote:
>
>> On 15/02/2012 17:21, Benjamin Root wrote:
>>> On Tue, Feb 14, 2012 at 8:58 AM, Mark Lawrence>> wrote:
>>>
 On 14/02/2012 13:52, Debashish Saha wrote:
> import numpy
>
> from enthought.mayavi import mlab
>
> #def test_mesh():
> #"""A very pretty picture of spherical harmonics translated from
>
> #the octaviz example."""
> for r in range (1,5):
>   print r
>
>
>   pi = numpy.pi
>
>   cos = numpy.cos
>
>   sin = numpy.sin
>
>   dphi, dtheta, dz = pi/250.0, pi/250.0, 0.01
>
>   #[phi,theta] =
 numpy.mgrid[0:pi+dphi*1.5:dphi,0:2*pi+dtheta*1.5:dtheta]
>   [phi,z] = numpy.mgrid[0:2*pi+dphi*1.5:dphi,0:2+dz*1.5:dz]
>
>   m0 = 4; m1 = 3; m2 = 2; m3 = 3; m4 = 6; m5 = 2; m6 = 6; m7 = 4;
>
>  # r = sin(m0*phi)**m1 + cos(m2*phi)**m3 + 5*sin(m4*theta)**m5 +
> cos(m6*theta)**m7
>
>   #x = 1*sin(phi)*cos(theta)
>
>   #y = 1*sin(phi)*sin(theta)
>
>   #z = 1*cos(phi);
>   x=r*cos(phi)
>   y=r*sin(phi)
>   z=z
>   i=['Reds','greens','autumn','purples']
>   print i[r-1]
>   e=i[r-1]
>
>   mlab.mesh(x, y, z,colormap='e')
>   #print i[r-1]
>
> Error:
> TypeError Traceback (most recent call
 last)
> C:\Python27\lib\site-packages\IPython\utils\py3compat.pyc in
> execfile(fname, glob, loc)
>   166 else:
>   167 filename = fname
> -->168 exec compile(scripttext, filename, 'exec') in
>> glob,
 loc
>   169 else:
>   170 def execfile(fname, *where):
>
> C:\Users\as\jhgf.py in()
>24 print i[r-1]
>25 e=i[r-1]
> --->26 mlab.mesh(x, y, z,'e')
>27 #print i[r-1]
>
>28
>
> C:\Python27\lib\site-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'):
>
> C:\Python27\lib\site-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:
>
> C:\Python27\lib\site-packages\mayavi\tools\helper_functions.pyc in
> __call_internal__(self, *args, **kwargs)
>   830 filters.
>   831 """
> -->832 self.source = self._source_function(*args, **kwargs)
>   833 kwargs.pop('name', None)
>   834 self.store_kwargs(kwargs)
>
> TypeError: grid_source() takes exactly 3 arguments (4 given)
>
>

>> --
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3,
>> MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d

 Didn't this get answered on the python tutor mailing list within the
 last couple of hours?  What's with it with you?

 --
 Cheers.

 Mark Lawrence.


>>> A couple of things I would like to point out here:
>>>
>>> 1.) It is possible that Debashish sent similar questions to multiple
>>> mailing lists in the hopes to maximize the chance of getting a response.
>>> It may only "appear" that this thread was started after having the
>> question
>>> answered on another mailing list because of the delays that are notorious
>>> on this list.  I suspect he sent both emails at around the same time, but
>>> the python tutors list processed it faster than the matplotlib-users
>> list.
>>>
>>> Therefore...
>>>
>>> 2.) I would like to make sure that this mailing list remains a welcoming
>>> forum for all users, and for all of us to understand that people have
>>> different mailing habits that we may not be familiar with.  Therefore,
>>> gentle reminders of mailing decorum (such as reminders to bottom-post)
>>> should be the response, not chastising.
>>>
>>> -- Debashish,
>>>
>>> We are more than happy to help you.  Please keep your question to a
>> single
>>> mailing list at a time.  The users on the mailing list will let you know
>> if
>>> you should direct your q

Re: [Matplotlib-users] problem in plotting cylinders with differnet colour

2012-02-15 Thread Benjamin Root
On Wed, Feb 15, 2012 at 2:52 PM, Mark Lawrence wrote:

> On 15/02/2012 17:21, Benjamin Root wrote:
> > On Tue, Feb 14, 2012 at 8:58 AM, Mark Lawrence >wrote:
> >
> >> On 14/02/2012 13:52, Debashish Saha wrote:
> >>> import numpy
> >>>
> >>> from enthought.mayavi import mlab
> >>>
> >>> #def test_mesh():
> >>> #"""A very pretty picture of spherical harmonics translated from
> >>>
> >>> #the octaviz example."""
> >>> for r in range (1,5):
> >>>  print r
> >>>
> >>>
> >>>  pi = numpy.pi
> >>>
> >>>  cos = numpy.cos
> >>>
> >>>  sin = numpy.sin
> >>>
> >>>  dphi, dtheta, dz = pi/250.0, pi/250.0, 0.01
> >>>
> >>>  #[phi,theta] =
> >> numpy.mgrid[0:pi+dphi*1.5:dphi,0:2*pi+dtheta*1.5:dtheta]
> >>>  [phi,z] = numpy.mgrid[0:2*pi+dphi*1.5:dphi,0:2+dz*1.5:dz]
> >>>
> >>>  m0 = 4; m1 = 3; m2 = 2; m3 = 3; m4 = 6; m5 = 2; m6 = 6; m7 = 4;
> >>>
> >>> # r = sin(m0*phi)**m1 + cos(m2*phi)**m3 + 5*sin(m4*theta)**m5 +
> >>> cos(m6*theta)**m7
> >>>
> >>>  #x = 1*sin(phi)*cos(theta)
> >>>
> >>>  #y = 1*sin(phi)*sin(theta)
> >>>
> >>>  #z = 1*cos(phi);
> >>>  x=r*cos(phi)
> >>>  y=r*sin(phi)
> >>>  z=z
> >>>  i=['Reds','greens','autumn','purples']
> >>>  print i[r-1]
> >>>  e=i[r-1]
> >>>
> >>>  mlab.mesh(x, y, z,colormap='e')
> >>>  #print i[r-1]
> >>>
> >>> Error:
> >>> TypeError Traceback (most recent call
> >> last)
> >>> C:\Python27\lib\site-packages\IPython\utils\py3compat.pyc in
> >>> execfile(fname, glob, loc)
> >>>  166 else:
> >>>  167 filename = fname
> >>> -->   168 exec compile(scripttext, filename, 'exec') in
> glob,
> >> loc
> >>>  169 else:
> >>>  170 def execfile(fname, *where):
> >>>
> >>> C:\Users\as\jhgf.py in()
> >>>   24 print i[r-1]
> >>>   25 e=i[r-1]
> >>> --->   26 mlab.mesh(x, y, z,'e')
> >>>   27 #print i[r-1]
> >>>
> >>>   28
> >>>
> >>> C:\Python27\lib\site-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'):
> >>>
> >>> C:\Python27\lib\site-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:
> >>>
> >>> C:\Python27\lib\site-packages\mayavi\tools\helper_functions.pyc in
> >>> __call_internal__(self, *args, **kwargs)
> >>>  830 filters.
> >>>  831 """
> >>> -->   832 self.source = self._source_function(*args, **kwargs)
> >>>  833 kwargs.pop('name', None)
> >>>  834 self.store_kwargs(kwargs)
> >>>
> >>> TypeError: grid_source() takes exactly 3 arguments (4 given)
> >>>
> >>>
> >>
> --
> >>> Keep Your Developer Skills Current with LearnDevNow!
> >>> The most comprehensive online learning library for Microsoft developers
> >>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3,
> MVC3,
> >>> Metro Style Apps, more. Free future releases when you subscribe now!
> >>> http://p.sf.net/sfu/learndevnow-d2d
> >>
> >> Didn't this get answered on the python tutor mailing list within the
> >> last couple of hours?  What's with it with you?
> >>
> >> --
> >> Cheers.
> >>
> >> Mark Lawrence.
> >>
> >>
> > A couple of things I would like to point out here:
> >
> > 1.) It is possible that Debashish sent similar questions to multiple
> > mailing lists in the hopes to maximize the chance of getting a response.
> > It may only "appear" that this thread was started after having the
> question
> > answered on another mailing list because of the delays that are notorious
> > on this list.  I suspect he sent both emails at around the same time, but
> > the python tutors list processed it faster than the matplotlib-users
> list.
> >
> > Therefore...
> >
> > 2.) I would like to make sure that this mailing list remains a welcoming
> > forum for all users, and for all of us to understand that people have
> > different mailing habits that we may not be familiar with.  Therefore,
> > gentle reminders of mailing decorum (such as reminders to bottom-post)
> > should be the response, not chastising.
> >
> > -- Debashish,
> >
> > We are more than happy to help you.  Please keep your question to a
> single
> > mailing list at a time.  The users on the mailing list will let you know
> if
> > you should direct your question elsewhere.  In the case of your problem,
> it
> > is not matplotlib, but mayavi.  Hopefull

Re: [Matplotlib-users] problem in plotting cylinders with differnet colour

2012-02-15 Thread Mark Lawrence
On 15/02/2012 17:21, Benjamin Root wrote:
> On Tue, Feb 14, 2012 at 8:58 AM, Mark Lawrencewrote:
>
>> On 14/02/2012 13:52, Debashish Saha wrote:
>>> import numpy
>>>
>>> from enthought.mayavi import mlab
>>>
>>> #def test_mesh():
>>> #"""A very pretty picture of spherical harmonics translated from
>>>
>>> #the octaviz example."""
>>> for r in range (1,5):
>>>  print r
>>>
>>>
>>>  pi = numpy.pi
>>>
>>>  cos = numpy.cos
>>>
>>>  sin = numpy.sin
>>>
>>>  dphi, dtheta, dz = pi/250.0, pi/250.0, 0.01
>>>
>>>  #[phi,theta] =
>> numpy.mgrid[0:pi+dphi*1.5:dphi,0:2*pi+dtheta*1.5:dtheta]
>>>  [phi,z] = numpy.mgrid[0:2*pi+dphi*1.5:dphi,0:2+dz*1.5:dz]
>>>
>>>  m0 = 4; m1 = 3; m2 = 2; m3 = 3; m4 = 6; m5 = 2; m6 = 6; m7 = 4;
>>>
>>> # r = sin(m0*phi)**m1 + cos(m2*phi)**m3 + 5*sin(m4*theta)**m5 +
>>> cos(m6*theta)**m7
>>>
>>>  #x = 1*sin(phi)*cos(theta)
>>>
>>>  #y = 1*sin(phi)*sin(theta)
>>>
>>>  #z = 1*cos(phi);
>>>  x=r*cos(phi)
>>>  y=r*sin(phi)
>>>  z=z
>>>  i=['Reds','greens','autumn','purples']
>>>  print i[r-1]
>>>  e=i[r-1]
>>>
>>>  mlab.mesh(x, y, z,colormap='e')
>>>  #print i[r-1]
>>>
>>> Error:
>>> TypeError Traceback (most recent call
>> last)
>>> C:\Python27\lib\site-packages\IPython\utils\py3compat.pyc in
>>> execfile(fname, glob, loc)
>>>  166 else:
>>>  167 filename = fname
>>> -->   168 exec compile(scripttext, filename, 'exec') in glob,
>> loc
>>>  169 else:
>>>  170 def execfile(fname, *where):
>>>
>>> C:\Users\as\jhgf.py in()
>>>   24 print i[r-1]
>>>   25 e=i[r-1]
>>> --->   26 mlab.mesh(x, y, z,'e')
>>>   27 #print i[r-1]
>>>
>>>   28
>>>
>>> C:\Python27\lib\site-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'):
>>>
>>> C:\Python27\lib\site-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:
>>>
>>> C:\Python27\lib\site-packages\mayavi\tools\helper_functions.pyc in
>>> __call_internal__(self, *args, **kwargs)
>>>  830 filters.
>>>  831 """
>>> -->   832 self.source = self._source_function(*args, **kwargs)
>>>  833 kwargs.pop('name', None)
>>>  834 self.store_kwargs(kwargs)
>>>
>>> TypeError: grid_source() takes exactly 3 arguments (4 given)
>>>
>>>
>> --
>>> Keep Your Developer Skills Current with LearnDevNow!
>>> The most comprehensive online learning library for Microsoft developers
>>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>>> Metro Style Apps, more. Free future releases when you subscribe now!
>>> http://p.sf.net/sfu/learndevnow-d2d
>>
>> Didn't this get answered on the python tutor mailing list within the
>> last couple of hours?  What's with it with you?
>>
>> --
>> Cheers.
>>
>> Mark Lawrence.
>>
>>
> A couple of things I would like to point out here:
>
> 1.) It is possible that Debashish sent similar questions to multiple
> mailing lists in the hopes to maximize the chance of getting a response.
> It may only "appear" that this thread was started after having the question
> answered on another mailing list because of the delays that are notorious
> on this list.  I suspect he sent both emails at around the same time, but
> the python tutors list processed it faster than the matplotlib-users list.
>
> Therefore...
>
> 2.) I would like to make sure that this mailing list remains a welcoming
> forum for all users, and for all of us to understand that people have
> different mailing habits that we may not be familiar with.  Therefore,
> gentle reminders of mailing decorum (such as reminders to bottom-post)
> should be the response, not chastising.
>
> -- Debashish,
>
> We are more than happy to help you.  Please keep your question to a single
> mailing list at a time.  The users on the mailing list will let you know if
> you should direct your question elsewhere.  In the case of your problem, it
> is not matplotlib, but mayavi.  Hopefully, you have been directed to the
> mayavi mailing list.
>
> Cheers!
> Ben Root
>
>
>
>
> --
> Virtualization&  Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delive

Re: [Matplotlib-users] problem in plotting cylinders with differnet colour

2012-02-15 Thread Benjamin Root
On Tue, Feb 14, 2012 at 8:58 AM, Mark Lawrence wrote:

> On 14/02/2012 13:52, Debashish Saha wrote:
> > import numpy
> >
> > from enthought.mayavi import mlab
> >
> > #def test_mesh():
> > #"""A very pretty picture of spherical harmonics translated from
> >
> > #the octaviz example."""
> > for r in range (1,5):
> > print r
> >
> >
> > pi = numpy.pi
> >
> > cos = numpy.cos
> >
> > sin = numpy.sin
> >
> > dphi, dtheta, dz = pi/250.0, pi/250.0, 0.01
> >
> > #[phi,theta] =
> numpy.mgrid[0:pi+dphi*1.5:dphi,0:2*pi+dtheta*1.5:dtheta]
> > [phi,z] = numpy.mgrid[0:2*pi+dphi*1.5:dphi,0:2+dz*1.5:dz]
> >
> > m0 = 4; m1 = 3; m2 = 2; m3 = 3; m4 = 6; m5 = 2; m6 = 6; m7 = 4;
> >
> ># r = sin(m0*phi)**m1 + cos(m2*phi)**m3 + 5*sin(m4*theta)**m5 +
> > cos(m6*theta)**m7
> >
> > #x = 1*sin(phi)*cos(theta)
> >
> > #y = 1*sin(phi)*sin(theta)
> >
> > #z = 1*cos(phi);
> > x=r*cos(phi)
> > y=r*sin(phi)
> > z=z
> > i=['Reds','greens','autumn','purples']
> > print i[r-1]
> > e=i[r-1]
> >
> > mlab.mesh(x, y, z,colormap='e')
> > #print i[r-1]
> >
> > Error:
> > TypeError Traceback (most recent call
> last)
> > C:\Python27\lib\site-packages\IPython\utils\py3compat.pyc in
> > execfile(fname, glob, loc)
> > 166 else:
> > 167 filename = fname
> > -->  168 exec compile(scripttext, filename, 'exec') in glob,
> loc
> > 169 else:
> > 170 def execfile(fname, *where):
> >
> > C:\Users\as\jhgf.py in()
> >  24 print i[r-1]
> >  25 e=i[r-1]
> > --->  26 mlab.mesh(x, y, z,'e')
> >  27 #print i[r-1]
> >
> >  28
> >
> > C:\Python27\lib\site-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'):
> >
> > C:\Python27\lib\site-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:
> >
> > C:\Python27\lib\site-packages\mayavi\tools\helper_functions.pyc in
> > __call_internal__(self, *args, **kwargs)
> > 830 filters.
> > 831 """
> > -->  832 self.source = self._source_function(*args, **kwargs)
> > 833 kwargs.pop('name', None)
> > 834 self.store_kwargs(kwargs)
> >
> > TypeError: grid_source() takes exactly 3 arguments (4 given)
> >
> >
> --
> > Keep Your Developer Skills Current with LearnDevNow!
> > The most comprehensive online learning library for Microsoft developers
> > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> > Metro Style Apps, more. Free future releases when you subscribe now!
> > http://p.sf.net/sfu/learndevnow-d2d
>
> Didn't this get answered on the python tutor mailing list within the
> last couple of hours?  What's with it with you?
>
> --
> Cheers.
>
> Mark Lawrence.
>
>
A couple of things I would like to point out here:

1.) It is possible that Debashish sent similar questions to multiple
mailing lists in the hopes to maximize the chance of getting a response.
It may only "appear" that this thread was started after having the question
answered on another mailing list because of the delays that are notorious
on this list.  I suspect he sent both emails at around the same time, but
the python tutors list processed it faster than the matplotlib-users list.

Therefore...

2.) I would like to make sure that this mailing list remains a welcoming
forum for all users, and for all of us to understand that people have
different mailing habits that we may not be familiar with.  Therefore,
gentle reminders of mailing decorum (such as reminders to bottom-post)
should be the response, not chastising.

-- Debashish,

We are more than happy to help you.  Please keep your question to a single
mailing list at a time.  The users on the mailing list will let you know if
you should direct your question elsewhere.  In the case of your problem, it
is not matplotlib, but mayavi.  Hopefully, you have been directed to the
mayavi mailing list.

Cheers!
Ben Root
--
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/___
Matplotlib-users mailing list
Matplotlib-users@lists.

Re: [Matplotlib-users] problem in plotting cylinders with differnet colour

2012-02-14 Thread Mark Lawrence
On 14/02/2012 13:52, Debashish Saha wrote:
> import numpy
>
> from enthought.mayavi import mlab
>
> #def test_mesh():
> #"""A very pretty picture of spherical harmonics translated from
>
> #the octaviz example."""
> for r in range (1,5):
> print r
>
>
> pi = numpy.pi
>
> cos = numpy.cos
>
> sin = numpy.sin
>
> dphi, dtheta, dz = pi/250.0, pi/250.0, 0.01
>
> #[phi,theta] = numpy.mgrid[0:pi+dphi*1.5:dphi,0:2*pi+dtheta*1.5:dtheta]
> [phi,z] = numpy.mgrid[0:2*pi+dphi*1.5:dphi,0:2+dz*1.5:dz]
>
> m0 = 4; m1 = 3; m2 = 2; m3 = 3; m4 = 6; m5 = 2; m6 = 6; m7 = 4;
>
># r = sin(m0*phi)**m1 + cos(m2*phi)**m3 + 5*sin(m4*theta)**m5 +
> cos(m6*theta)**m7
>
> #x = 1*sin(phi)*cos(theta)
>
> #y = 1*sin(phi)*sin(theta)
>
> #z = 1*cos(phi);
> x=r*cos(phi)
> y=r*sin(phi)
> z=z
> i=['Reds','greens','autumn','purples']
> print i[r-1]
> e=i[r-1]
>
> mlab.mesh(x, y, z,colormap='e')
> #print i[r-1]
>
> Error:
> TypeError Traceback (most recent call last)
> C:\Python27\lib\site-packages\IPython\utils\py3compat.pyc in
> execfile(fname, glob, loc)
> 166 else:
> 167 filename = fname
> -->  168 exec compile(scripttext, filename, 'exec') in glob, loc
> 169 else:
> 170 def execfile(fname, *where):
>
> C:\Users\as\jhgf.py in()
>  24 print i[r-1]
>  25 e=i[r-1]
> --->  26 mlab.mesh(x, y, z,'e')
>  27 #print i[r-1]
>
>  28
>
> C:\Python27\lib\site-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'):
>
> C:\Python27\lib\site-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:
>
> C:\Python27\lib\site-packages\mayavi\tools\helper_functions.pyc in
> __call_internal__(self, *args, **kwargs)
> 830 filters.
> 831 """
> -->  832 self.source = self._source_function(*args, **kwargs)
> 833 kwargs.pop('name', None)
> 834 self.store_kwargs(kwargs)
>
> TypeError: grid_source() takes exactly 3 arguments (4 given)
>
> --
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d

Didn't this get answered on the python tutor mailing list within the 
last couple of hours?  What's with it with you?

-- 
Cheers.

Mark Lawrence.


--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] problem in plotting cylinders with differnet colour

2012-02-14 Thread Debashish Saha
import numpy

from enthought.mayavi import mlab

#def test_mesh():
#"""A very pretty picture of spherical harmonics translated from

#the octaviz example."""
for r in range (1,5):
   print r


   pi = numpy.pi

   cos = numpy.cos

   sin = numpy.sin

   dphi, dtheta, dz = pi/250.0, pi/250.0, 0.01

   #[phi,theta] = numpy.mgrid[0:pi+dphi*1.5:dphi,0:2*pi+dtheta*1.5:dtheta]
   [phi,z] = numpy.mgrid[0:2*pi+dphi*1.5:dphi,0:2+dz*1.5:dz]

   m0 = 4; m1 = 3; m2 = 2; m3 = 3; m4 = 6; m5 = 2; m6 = 6; m7 = 4;

  # r = sin(m0*phi)**m1 + cos(m2*phi)**m3 + 5*sin(m4*theta)**m5 +
cos(m6*theta)**m7

   #x = 1*sin(phi)*cos(theta)

   #y = 1*sin(phi)*sin(theta)

   #z = 1*cos(phi);
   x=r*cos(phi)
   y=r*sin(phi)
   z=z
   i=['Reds','greens','autumn','purples']
   print i[r-1]
   e=i[r-1]

   mlab.mesh(x, y, z,colormap='e')
   #print i[r-1]

Error:
TypeError Traceback (most recent call last)
C:\Python27\lib\site-packages\IPython\utils\py3compat.pyc in
execfile(fname, glob, loc)
   166 else:
   167 filename = fname
--> 168 exec compile(scripttext, filename, 'exec') in glob, loc
   169 else:
   170 def execfile(fname, *where):

C:\Users\as\jhgf.py in ()
24 print i[r-1]
25 e=i[r-1]
---> 26 mlab.mesh(x, y, z,'e')
27 #print i[r-1]

28

C:\Python27\lib\site-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'):

C:\Python27\lib\site-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:

C:\Python27\lib\site-packages\mayavi\tools\helper_functions.pyc in
__call_internal__(self, *args, **kwargs)
   830 filters.
   831 """
--> 832 self.source = self._source_function(*args, **kwargs)
   833 kwargs.pop('name', None)
   834 self.store_kwargs(kwargs)

TypeError: grid_source() takes exactly 3 arguments (4 given)

--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users