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.
>
> Here's one way to do it:
>
>
> #!/usr/bin/env python
>
> import matplotlib
> from matplotlib.patches import Circle
> import pylab
>
> def myscatter(ax, colormap, x, y, radii, colors):
> for x1,y1,r,c in zip(x, y, radii, colormap(colors)):
> ax.add_patch(Circle((x1,y1), r, fc=c))
>
> fig=pylab.figure()
> ax=fig.add_subplot(111)
>
> myscatter(ax, matplotlib.cm.jet,
> pylab.rand(20), pylab.rand(20), 0.1*pylab.rand(20),
> pylab.rand(20))
>
> ax.axis('equal')
> pylab.show()
>
>
>
>
Hi!
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)
Any idea?
Thanks guys.
--
View this message in context:
http://www.nabble.com/Drawing-filled-circles-%28discs%29-tf4441651.html#a12776069
Sent from the matplotlib - users mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users