>>>>> "Yannick" == Yannick Copin <[EMAIL PROTECTED]> writes:
Yannick> Hi, I'd like to use axhspan, but specifying both y *and*
Yannick> x extents in *data* units (by default, y is specified in
Yannick> data units, and x in axes -- relative 0-1 -- units). How
Yannick> should I proceed?
Yannick> I naively tried to play with gca().transAxes and so on,
Yannick> but I must admit I was utterly confused...
Yannick> Or should I directly draw a rectangle? (but how to?)
Yes, you should draw a rectangle. Eg,
from matplotlib.patches import Rectangle
r = Rectangle((left, bottom), width, height, facecolor='red')
ax.add_patch(r)
One thing to be aware of is that the axes datalimits are not updated
on a call to add_patch, so autoscaling may be off. You can update the
datalim yourself by doing
ax.update_datalim([(left, bottom), (right, top)])
and then
ax.autoscale_view()
It might be worth adding some convenience functions to draw basic
primitives like this, ie one would rather do
ax.rectangle((left, bottom), width, height, facecolor='red')
or
ax.circle((x,y), radius=5, edgecolor='green')
and not have to worry about the rest
JDH
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users