Clipping of axes frame rectangle.

I am having some problems with the axes frame being clipped.

Consider the following:

from pylab import *
fill([0,1,1,0],[0,0,1,1],facecolor=(1,1,1),edgecolor=(1,1,1))
axis([-1,1,-1,1])
gca().get_frame().set_linewidth(20)
show()

I have made the frame thick to emphasize the problem: When I plot
things, they overwrite part of the frame which looks bad. What is the
simplest/best way to avoid this?

I would like the axes frame to be drawn only outside of the actual
plot area, but I cannot figure out how to achieve this. (It seems
like this might also be desirable default behaviour...). Otherwise,
I would settle for the frame being drawn over top of the plot so that
it is smooth.

A crude hack would be to plot a blank rectangle. It should also be
possible to use clipping somehow, but I do not have much experience
with that.

Is there a simple solution?

Thanks for any help,
Michael

I've had the same problem as you. My crude hack was to slightly extend the
xlim and ylim as in

    xlim(xmin-xclip, xmax+xclip)
    ylim(ymin-yclip, ymax+yclip)

where xclip and yclip are small values (about 0.5% of the x and y ranges).

···

On Friday 26 May 2006 11:08 am, Michael McNeil Forbes wrote:

I am having some problems with the axes frame being clipped.

Consider the following:

from pylab import *
fill([0,1,1,0],[0,0,1,1],facecolor=(1,1,1),edgecolor=(1,1,1))
axis([-1,1,-1,1])
gca().get_frame().set_linewidth(20)
show()