Re: [Matplotlib-users] Drawing filled circles (discs)

2008-06-16 Thread sidimok
> Or are you effectively doing a scatter plot? Could you use scatter? > > Eric > Yes, I've already tried doing the trick with a scatter plot, but since the filling colors correspond to a "physical quantity" and the radius of the scatters are the "real" circle radius, using RegularPolygons is

Re: [Matplotlib-users] Drawing filled circles (discs)

2008-06-16 Thread Eric Firing
John Hunter wrote: > On Sun, Jun 15, 2008 at 7:48 AM, sidimok <[EMAIL PROTECTED]> wrote: > >> The code above was working for me as a charm, but since the new matlplotlib >> flavor 0.98, I'm getting this error message: >> AttributeError: 'CirclePolygon' object has no attribute 'get_verts' << >

Re: [Matplotlib-users] Drawing filled circles (discs)

2008-06-16 Thread John Hunter
On Sun, Jun 15, 2008 at 7:48 AM, sidimok <[EMAIL PROTECTED]> wrote: > The code above was working for me as a charm, but since the new matlplotlib > flavor 0.98, I'm getting this error message: > >>> AttributeError: 'CirclePolygon' object has no attribute 'get_verts' << > > Any idea? The new patch

Re: [Matplotlib-users] Drawing filled circles (discs)

2008-06-16 Thread sidimok
import matplotlib from matplotlib.patches import CirclePolygon from matplotlib.collections import PolyCollection import pylab fig=pylab.figure() ax=fig.add_subplot(111) resolution = 50 # the number of vertices N = 20 x = pylab.rand(N) y = pylab.rand(N) radii = 0.1*pylab.rand(N

Re: [Matplotlib-users] Drawing filled circles (discs)

2007-09-20 Thread Jouni K . Seppänen
sidimok <[EMAIL PROTECTED]> writes: > Thank you very much indeed for the help, both solutions work like a > charm. However Dave's one gives rough cirlces, approximated by > polygones, which is not very accurate for my buisness. As he said, increasing the number of vertices could be enough, depend

Re: [Matplotlib-users] Drawing filled circles (discs)

2007-09-20 Thread Mika, David P (GE, Research)
Behalf Of sidimok Sent: Thursday, September 20, 2007 4:59 AM To: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] Drawing filled circles (discs) Mika, David P (GE, Research) wrote: > > How about this solution? I'm a complete newbe, but this seems to do > th

Re: [Matplotlib-users] Drawing filled circles (discs)

2007-09-20 Thread sidimok
Mika, David P (GE, Research) wrote: > > How about this solution? I'm a complete newbe, but this seems to do the > trick. I didn't see a CircleCollection so I used CirclePolygon to > generate vertices for a circle; these I grab and toss into a > PolyCollection. Enjoy, Dave > > Hi all! Than

Re: [Matplotlib-users] Drawing filled circles (discs)

2007-09-19 Thread Mika, David P (GE, Research)
On Behalf Of Jouni K. Seppänen Sent: Wednesday, September 19, 2007 11:03 AM To: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] Drawing filled circles (discs) sidimok <[EMAIL PROTECTED]> writes: > Well, let's take the one you've proposed the last time. How

Re: [Matplotlib-users] Drawing filled circles (discs)

2007-09-19 Thread Jouni K . Seppänen
sidimok <[EMAIL PROTECTED]> writes: > Well, let's take the one you've proposed the last time. How than can i put a > colorbar beside the plot? Add in the imports from matplotlib.colorbar import ColorbarBase, make_axes and change the myscatter function to def myscatter(ax, colormap, x, y, radii

Re: [Matplotlib-users] Drawing filled circles (discs)

2007-09-19 Thread sidimok
Jouni K. Seppänen wrote: > > > It would help to give a complete example. ColorbarBase itself does not > create a colorbar but is useful for drawing a colorbar in existing axes. > > Well, let's take the one you've proposed the last time. How than can i put a colorbar beside the plot? #!/usr/

Re: [Matplotlib-users] Drawing filled circles (discs)

2007-09-19 Thread Jouni K . Seppänen
sidimok <[EMAIL PROTECTED]> writes: > It works just fine, however the colorbar I'm getting with the following > commands is very tiny. > > norm = matplotlib.colors.Normalize(vmin=x[0], vmax=x[-1]) # just an example > cb = matplotlib.colorbar.ColorbarBase(ax, cmap=matplotlib.cm.jet, norm=norm) It

Re: [Matplotlib-users] Drawing filled circles (discs)

2007-09-19 Thread sidimok
Jouni K. Seppänen wrote: > > sidimok <[EMAIL PROTECTED]> writes: > >> I'm using matplotlib to draw (from matplotlib.Patches import Circle) >> filled >> circles (disks) from a formatted data file, and would give each disk a >> color relative to a variable, as done by the "scatter" function. >

Re: [Matplotlib-users] Drawing filled circles (discs)

2007-09-15 Thread Jouni K . Seppänen
sidimok <[EMAIL PROTECTED]> writes: > I'm using matplotlib to draw (from matplotlib.Patches import Circle) filled > circles (disks) from a formatted data file, and would give each disk a > color relative to a variable, as done by the "scatter" function. Here's one way to do it: #!/usr/bin/env p

[Matplotlib-users] Drawing filled circles (discs)

2007-09-15 Thread sidimok
Hi all! I'm using matplotlib to draw (from matplotlib.Patches import Circle) filled circles (disks) from a formatted data file, and would give each disk a color relative to a variable, as done by the "scatter" function. Any idea how to handle this, please? Thank's. -- View this message in con