[Matplotlib-users] Event attributes

2007-01-31 Thread Martin Wilson
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


-
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Event attributes

2007-02-05 Thread Martin Wilson
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


-
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users