2 points:
> 1) Is there any reason why the Patch class doesn't have
> get_xdata() and get_ydata() methods? 1b) If not, can we
> add them and let Axes.add_patch(patch) call
> "self.xaxis.datalim.update(patch.get_xdata())" ?
I removed this one day when I was trying to improve the painfully slow
pcolor code. The way patches were getting their xlimits was slow.
After spending some time with the profiler, I opted to set the axes
limits manually for scatter and pcolor rather than pay the additional
performance hit in add_patch. This makes the code a little more
difficult to maintain.
Perhaps better than get_xdata is get_xlim. What is the natural xdata
for a circle characterized by a center and radius? xlim is clear. I
added this for Polygon and modified the fill command to use it, and
will add it to the other patch commands and use it in add_patch in due
time. Or feel free to take the lead
> 2) I think there's still a Polygon facecolor bug. John, I
> thought you fixed the Polygon facecolor bug -- my
> patches.py code matches the bugfix you emailed the list,
> but I still don't get the facecolor with the PS, GTK or
> Agg backends.
The problem was that you didn't set fill=True in the Polygon
constructor. I added this and it works great. Here is my fill_demo
code - if you have something more impressive for the examples dir send
it along.
from matplotlib.matlab import *
t = arange(0.0, 1.01, 0.01)
s = sin(2*2*pi*t)
fill(t, s*exp(-5*t), 'r')
grid(True)
show()
Changes are in CVS.
Thanks!
JDH