interactive graphs

Greetings.

I have a colleague who I have worked hard to convert from matlab to matplotlib.

One issue that has come up is clickable graphs. He would like to be able to click on the graphs that matplotlib produces and actually have things happen. For example:

* Display information about a histogram, like the values that went into the bin.
* Have a callback called with information about where the click took place.

Is there any way to do this?

Simson Garfinkel wrote:

Greetings.

I have a colleague who I have worked hard to convert from matlab to matplotlib.

One issue that has come up is clickable graphs. He would like to be able to click on the graphs that matplotlib produces and actually have things happen. For example:

* Display information about a histogram, like the values that went into the bin.
* Have a callback called with information about where the click took place.

Is there any way to do this?

Yes. To begin, see examples/event_handling/pick_event_demo.py and pick_event_demo2.py.

On the web, the code is here:
http://matplotlib.sourceforge.net/examples/event_handling/index.html

Eric