ginput() equivalent?

Sajec,> Is there a simple way to grab x,y coordinates from active
    Sajec,> plot in a manner similar to using matlab's ginput()
    Sajec,> function?

It depends on what you mean by simple :slight_smile:

matplotlib provides a GUI independent way to capture basic events, eg
to get the mouse coordinates in screen and data units and button
clicks, key presses, etc.


Some people do not find callbacks intuitive. If you are one of these
people, you might try something like the following

from pylab import *

class MouseMonitor:
    event = None
    def __call__(self, event):
        self.event = event

mouse = MouseMonitor()
connect('button_press_event', mouse)


Now you can click on the plot, and get the coords like so

print mouse.event.xdata, mouse.event.ydata

for more information on the mouse event attributes

There are a couple of demos for event handling