Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added guiEvent to PickEvent #4121

Merged
merged 1 commit into from Feb 18, 2015

Conversation

eyurtsev
Copy link
Contributor

PickEvent.guiEvent is currenly set to None. However, the guiEvent is available within PickEvent.mouseevent.guiEvent. This looks like it was done by design, but I feel like it's somewhat of an API inconsistency.

Example of what I was trying to do that didn't work:

import matplotlib
import numpy as np
import matplotlib.pyplot as plt

def onpick(event):
    print event.mouseevent.guiEvent # <-- available
    print event.guiEvent # <--  no available, but this is what I expect to be able to use

x = [1, 2, 3]
y = [1, 2, 3]

fig, ax = plt.subplots()
ax.scatter(x, y, picker=True)
fig.canvas.mpl_connect('pick_event',  onpick)
plt.show()

@tacaswell tacaswell added this to the next point release milestone Feb 18, 2015
@tacaswell
Copy link
Member

I see no harm in this and it brings pick events up to match everything else.

👍 from me.

@blink1073
Copy link
Member

👍 thanks @eyurtsev!

tacaswell added a commit that referenced this pull request Feb 18, 2015
ENH : added guiEvent to PickEvent if available
@tacaswell tacaswell merged commit 6f20097 into matplotlib:master Feb 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants