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)
colors = 100*pylab.rand(N)
verts = []
for x1,y1,r in zip(x, y, radii):
circle = CirclePolygon((x1,y1), r, resolution)
verts.append(circle.get_verts())
p = PolyCollection(verts, cmap=matplotlib.cm.jet)
p.set_array(pylab.array(colors))
ax.add_patch(p)
pylab.colorbar(p)
ax.axis('equal')
pylab.show()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Hi everyone,
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?
--
View this message in context:
http://www.nabble.com/Drawing-filled-circles-%28discs%29-tp12672676p17849649.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users