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.

So, if I have something like

class DiagramWidget(FigureCanvas):
    def __init__(self, parent):
        fig = Figure()
        self.axes = fig.add_subplot(111)
        self.xlimits = (0, 4000)
        FigureCanvas.__init__(self, fig)
        self.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 = ???
        upper_limit_diag_y = ???
        ...

where I would need to replace the ??? with some transformation from
event.xdata, event.ydata, and the min and max of the y axis. How could I
do that?

Cheers 

Ole


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to