Re: [Matplotlib-users] qt4: Transforming to display coordinates

2009-06-04 Thread John Hunter
On Thu, Jun 4, 2009 at 9:26 AM, Ole Streicher wrote: >> But to answer your question about matplotlib transforms. You could do >> ax = event.inaxes # the axes the event occurred in >> x, y = ax.transData.transform_point((event.xdata, event.ydata)) Yes: xdata, ydata = ax.transData.invert

Re: [Matplotlib-users] qt4: Transforming to display coordinates

2009-06-04 Thread Ole Streicher
Hi John, thank you four your helpful answer. John Hunter writes: > On Thu, Jun 4, 2009 at 8:49 AM, Ole Streicher wrote: >>def on_move(self, event) >>mouse_pos_diag_x = ???(event.xdata) >>mouse_pos_diag_y = ???(event.ydata) >> where I would need to replace the ??? with some t

Re: [Matplotlib-users] qt4: Transforming to display coordinates

2009-06-04 Thread John Hunter
On Thu, Jun 4, 2009 at 8:49 AM, Ole Streicher wrote: setParent(parent) >self.mpl_connect('motion_notify_event', self.on_move) > >def on_move(self, event) >mouse_pos_diag_x = ???(event.xdata) >mouse_pos_diag_y = ???(event.ydata) >lower_limit_diag_y = ??? >

[Matplotlib-users] qt4: Transforming to display coordinates

2009-06-04 Thread Ole Streicher
Hi, I want to implement a cursor on a diagram using native Qt routines. For this, I would need to transform data (axis) coordinates to display coordinates. The manual of matplotlib, API "axes" just jays that there are some public attributes 'transData' and 'transAxis', but without an explanation.