From: Xavier G. <xav...@gm...> - 2009-03-24 20:01:08
|
Christopher Brown wrote: > Hi Xavier, > > XG> I'm trying to write a pyqt4 application including pylab plotting > XG> capabilities. > XG> Up to now, it looks like this (see in attachment). > XG> > XG> The picker works fine (I get the msg) *but* I also would like to get > XG> the (x,y) coordinates and the the corresponding value A[x,y]. > XG> Could someone tell me what I should do in on_pick with this "event" > XG> to get these data?? > XG> > XG> Xavier > > This works for me: > > def on_pick(self, event): > tt = event.artist.get_axes() > mouseevent = event.mouseevent > msg = "X is: " + str(mouseevent.xdata) + "\nY is: " + > str(mouseevent.ydata) > QMessageBox.information(self, "Click!", msg) > > I got some good tips on how to do this from > examples/event_handling/pick_event_demo.py > Thanks!! It works just fine :). IDL is dead. Qt4 python and numpy/scipy/numpy are great tools. Xavier |