On Tue, May 6, 2008 at 11:17 AM, Matthew Czesarski
<[EMAIL PROTECTED]> wrote:
> So I'm pretty successful so far. The only problem is that the coordinates
> are in canvas coordinates, not plot coordinates. Now, rather embarrassingly,
> I can't figure out how to get this right. It seems to be the case that all
> the examples are in plot coordinates. As of course is the readout in the
> GUI itself. Is there a simple way to fix this or do I have convert it to
> some other backend? Or use something else instead of FigureCanvasGTK? This,
> to me, made the most sense to me at the time of writing, although I must
> confess I'm still pretty new to this.
Use mpl events -- they work across user interface toolkits and handle
stuff like which axes did you click in and what are the data
coordinates
def onclick(event):
print 'axes', event.inaxes
if event.inaxes is None: return
print 'canvas', event.x, event.y
print 'data', event.xdata, event.ydata
cid = fig.canvas.mpl_connect('button_press_event', onclick)
See matplotlib.backend_bases.Event and derived classes for details on
available attributes. See
matplotlib.backend_bases.FigureCanvasBase.mpl_connect for details on
valid signals,
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users