From: Martin W. <mp...@bh...> - 2007-01-31 21:12:36
|
Hi, I'm using matplotlib in a GTK gui canvas with the GTKAgg backend. I'm connecting a mouse click 'button_press_event' to the click function. If I choose print event.x everything works fine. However I'm after the x value in terms of the x-axis not pixels. When I try print event.xdata I get an error message. Am I making a stupid mistake or is this a bug? Thanks Martin self.canvas.connect('button_press_event',self.click) def click(self,widget,event): print 'you clicked', event.xdata, event.ydata #print 'you clicked', event.x, event.y Traceback (most recent call last): File "./dangerplotpy", line 120, in click print 'you clicked', event.xdata, event.ydata AttributeError: xdata |