fill command

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 :slight_smile:

    > 2) I think there's still a Polygon facecolor bug. John, I
    > thought you fixed the Polygon facecolor bug -- my
    > 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')

Changes are in CVS.


Great! (Too bad SF's CVS servers are way behind for anonymous checkouts--it's driving me nuts! I had to piece together a recent CVS checkout by downloading the CVSROOT tarball...)

Now, my question is, can we set edgecolor=None on a patch and have it not draw the edges of the patch? Or whatever is the most matlab-compatible way, assuming one can do this in matlab. Or, perhaps by analogy to fill=True we could have stroke=True as well. Perhaps this is already "in there"--if so, what do I do?

Keep up the great work!

PGP.sig (155 Bytes)


On Tuesday, March 16, 2004, at 10:52 PM, John Hunter wrote:

Changes are in CVS.