putting "persistent" lines on figures

Hi,

I could've sworn I recently read about how to draw a line on a plot in such a way that you see it regardless of what the axis ranges are.

Now that I need it, I can't find it anywhere. I'm not even sure what to search for.

I suspect this is really trivial and hope some more advanced users can enlighten me.

Thanks,
--b

belinda thom wrote:

Hi,

I could've sworn I recently read about how to draw a line on a plot in such a way that you see it regardless of what the axis ranges are.

If you need horizontal or vertical lines specified in normalized coordinates (0 to 1 spans the axes) then you can use the Axes.axhline() and Axes.axvline() methods or their pylab function counterparts. There are also methods for specifying the length of the line in normalized coordinates and the position in data coordinates: axhspan() and axvspan(). See examples/axhspan.py for examples of both types using the pylab interface.

Eric