Re: [Matplotlib-users] Button and Mouse event

2014-09-29 Thread Christophe Bal
Hello. Concretly, I have one figure with some plots. I only want to have the coordinates of the mouse when it is clicked over this figure. On the other hand, when I click on the button, I have the button event, but also the mouse one. Maybe, one solution would be to know that the button has been

Re: [Matplotlib-users] Button and Mouse event

2014-09-28 Thread Benjamin Root
I am sorry, I am not sure that I understand what you are trying to do. Why do you want the same action to happen whenever you click the mouse button (anywhere in the figure), and whenever you click the mouse button (when you are over the button)? The two areas overlap, so it would always trigger th

Re: [Matplotlib-users] Button and Mouse event

2014-09-28 Thread Benjamin Root
Does this example help? http://matplotlib.org/examples/widgets/buttons.html With the Button widget, you won't need to do any mpl_connect calls, the widget takes care of that for you. Also, as a side note, the "button_press_event" does not refer to the button widgets, it refers to the mouse button.

[Matplotlib-users] Button and Mouse event

2014-09-27 Thread Christophe Bal
Hello. In the following code, I would like to add two buttons. Is there an easy way to do that ? Christophe import matplotlib.pyplot as plt from matplotlib.widgets import Button fig = plt.figure() plt.axes(xlim = (0, 3), ylim = (0, 3)) def onclick(event):