From: marc s. <m_s...@ho...> - 2004-03-30 09:21:52
|
Just installed matplotlib and tried an example from the homepage: Python 2.3.3 (#2, Mar 12 2004, 16:09:39) [GCC 3.2.2 (Mandrake Linux 9.1 3.2.2-3mdk)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>import matplotlib.matlab Numeric import failed... trying numarray. Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/local/lib/python2.3/site-packages/matplotlib/matlab.py", line 126, in ? from axes import Axes File "/usr/local/lib/python2.3/site-packages/matplotlib/axes.py", line 244, in ? class Axes(Artist): File "/usr/local/lib/python2.3/site-packages/matplotlib/axes.py", line 814, in Axe s def imshow(self, X, cmap = Grayscale(256)): File "/usr/local/lib/python2.3/site-packages/matplotlib/colors.py", line 213, in _ _init__ Colormap.__init__(self, N, 'gray') File "/usr/local/lib/python2.3/site-packages/matplotlib/colors.py", line 96, in __ init__ self._make_red() File "/usr/local/lib/python2.3/site-packages/matplotlib/colors.py", line 118, in _ make_red self.red = 1.0/self.N*arange(self.N, typecode=Float) TypeError: arange() got an unexpected keyword argument 'typecode' Why is this? Any suggestions? thanks, marc _________________________________________________________________ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail |
From: Marc S. <m_s...@ho...> - 2004-03-30 09:29:33
|
I just installed the latest matplotlib and wanted to run the first example from the homepage. But I got: Python 2.3.3 (#2, Mar 12 2004, 16:09:39) [GCC 3.2.2 (Mandrake Linux 9.1 3.2.2-3mdk)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import matplotlib.matlab Numeric import failed... trying numarray. Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/local/lib/python2.3/site-packages/matplotlib/matlab.py", line 126, in ? from axes import Axes File "/usr/local/lib/python2.3/site-packages/matplotlib/axes.py", line 244, in ? class Axes(Artist): File "/usr/local/lib/python2.3/site-packages/matplotlib/axes.py", line 814, in Axe s def imshow(self, X, cmap = Grayscale(256)): File "/usr/local/lib/python2.3/site-packages/matplotlib/colors.py", line 213, in _ _init__ Colormap.__init__(self, N, 'gray') File "/usr/local/lib/python2.3/site-packages/matplotlib/colors.py", line 96, in __ init__ self._make_red() File "/usr/local/lib/python2.3/site-packages/matplotlib/colors.py", line 118, in _ make_red self.red = 1.0/self.N*arange(self.N, typecode=Float) TypeError: arange() got an unexpected keyword argument 'typecode' Any suggestions? thanks, marc |
From: Peter G. <pgr...@ge...> - 2004-03-30 19:39:44
|
Hello: I am currently using matplotlib for all the plotting in the software I am writing. I will however need to produce polar plots. As John has mentioned they should be added at one point. So my shameless question is roughly what version could I expect them to be included in? My options are to either wait for it, write it on my own, or write a simple interface (for my code) to GNUPlot or some other tool. I have not done very much poking around in the current matplotlib libraries (other than changing some rather minor details) and have a feeling that this might take me the longest. Interfacing GNUPLot to my code would not take more than a few hours, but I would prefer to stay with matplotlib. Thanks for the great work. Best, -- Peter Groszkowski Gemini Observatory Tel: +1 808 974-2509 670 N. A'ohoku Place Fax: +1 808 935-9235 Hilo, Hawai'i 96720, USA |
From: Greg W. <gr...@th...> - 2004-03-31 02:11:33
|
As a temporary solution you might try just transforming your r,theta data to x, y and then drawing a grid over it. I looked at the classes and with the loglog already done as an example, it shouldn't be too hard to add polar plotting. So far though I haven't got any further than printing out some of the code. Here's a very rough example of a workaround. #!/usr/bin/python from Numeric import * from matplotlib.matlab import * def drawgrid(sp,rticlevels,thetaticlevels): for r in rticlevels: theta = arange(0,2*pi+0.05,0.05) x = r*cos(theta) y = r*sin(theta) sp.plot(x,y,'k-') for theta in thetaticlevels: x = rticlevels[-1]*cos(theta) y = rticlevels[-1]*sin(theta) sp.plot([0,x],[0,y],'k-') def polar(sp,r,theta,marker,rticlevels,thetaticlevels): x = r*cos(theta) y = r*sin(theta) sp.plot(x,y,marker) drawgrid(sp,rticlevels,thetaticlevels) return sp sp = subplot(111) theta = arange(0,pi,0.1) r = 0.5 + cos(theta) polar(sp,r,theta,'b-',arange(0.5,2.0,0.5),arange(0.,2*pi,pi/9.)) On Tue, 2004-03-30 at 14:32, Peter Groszkowski wrote: > Hello: > > I am currently using matplotlib for all the plotting in the software I am writing. I will however need to produce polar plots. As John has mentioned they should be added at one point. So my shameless question is roughly what version could I expect them to be included in? My options are to either wait for it, write it on my own, or write a simple interface (for my code) to GNUPlot or some other tool. I have not done very much poking around in the current matplotlib libraries (other than changing some rather minor details) and have a feeling that this might take me the longest. Interfacing GNUPLot to my code would not take more than a few hours, but I would prefer to stay with matplotlib. > > Thanks for the great work. > Best, |
From: John H. <jdh...@ac...> - 2004-03-31 13:16:29
|
>>>>> "Greg" == Greg Whittier <gr...@th...> writes: Greg> As a temporary solution you might try just transforming your Greg> r,theta data to x, y and then drawing a grid over it. A nice workaround. You may want to add axis('off') To get rid of the background axes. Greg> I looked at the classes and with the loglog already done as Greg> an example, it shouldn't be too hard to add polar plotting. Greg> So far though I haven't got any further than printing out Greg> some of the code. I was planning on taking a different tack, and derive a PolarAxes from Axes and RadialAxis from Axis, etc, which uses circles rather then lines for the radial gridlines, and so on. But you get so close with so little code that your approach may be better. If you want to keep forging ahead, I'm happy to leave the ball in your court. On an unrelated note, from Numeric import * from matplotlib.matlab import * is redundant because matplotlib.matlab imports all of numeric/numarray as well as MLab, fft, and some stuff from LinearAlgebra and Matrix. This is to provide a matlab like environment where most of the things you need are there. JDH |
From: Greg W. <gr...@th...> - 2004-04-02 10:54:40
|
One thing I'm not sure of is just how polar plots are supposed to work. If you set the axis background color, what gets colored? To get that right (if "in the circle" is right), I guess you'd need a new Axes class. In gnuplot, everything is drawn in the rectangle. "set polar; set grid; plot sin(3*t)" gives you a rectangular grid. You have to do "set grid polar" to circles. Of course gnuplot isn't what we're going for (How do you change background color? The only way I know is using xresources.) I guess the answer should be what matlab does (unless we can think of something better). Now I've never used matlab, so this will take a little research. I borrowed a matlab graphics book and will take a peek. Keep up the good work. Thanks, Greg PS Say hi to hyde park for me. I graduated in 98. On Wed, 2004-03-31 at 07:54, John Hunter wrote: > >>>>> "Greg" == Greg Whittier <gr...@th...> writes: > > Greg> As a temporary solution you might try just transforming your > Greg> r,theta data to x, y and then drawing a grid over it. > > A nice workaround. You may want to add > > axis('off') > > To get rid of the background axes. > > Greg> I looked at the classes and with the loglog already done as > Greg> an example, it shouldn't be too hard to add polar plotting. > Greg> So far though I haven't got any further than printing out > Greg> some of the code. > > I was planning on taking a different tack, and derive a PolarAxes from > Axes and RadialAxis from Axis, etc, which uses circles rather then > lines for the radial gridlines, and so on. But you get so close with > so little code that your approach may be better. If you want to keep > forging ahead, I'm happy to leave the ball in your court. > > On an unrelated note, > > from Numeric import * > from matplotlib.matlab import * > > is redundant because matplotlib.matlab imports all of numeric/numarray > as well as MLab, fft, and some stuff from LinearAlgebra and Matrix. > This is to provide a matlab like environment where most of the things > you need are there. > > JDH > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Greg Whittier <gr...@th...> |