How control whether text & plot elements can go beyond
> EDGE of plot? Is it possible to have some plot
> elements and text be able to go over and others get
> chopped off?
You can turn the clipping attribute on or off for any artist element.
Artist is base class for all matplotlib elements in the figure
(Figure, Axes, Line2D, Patches, Text...)
http://matplotlib.sf.net/matplotlib.artist.html
You will want to set the "clip_on" attribute for any line (or text or
whatever) element
t = ax.text(x,y,s)
t.set_clip_on(False)
l, = ax.plot([1,2,3])
l.set_clip_on(False)
Or you can use setp to control the properties of one or more artists
setp([t,l], clip_on=False)
By default when clpping is on, the artists are clipped to the edges of
the Axes rectangle. You can control the clipping box by passing a
custom bbox to clip_box attribute
from pylab import figure, show, draw, rand
from matplotlib.transforms import lbwh_to_bbox
bbox = lbwh_to_bbox(100,200,50,70)
fig = figure()
ax = fig.add_subplot(111)
line, = ax.plot(rand(100), rand(100))
line.set_clip_box(bbox)
show()
Note that the clip box is in figure coordinates (pixels from lower,
left)
JDH