Skip to content

added guiEvent to PickEvent#4121

Merged
tacaswell merged 1 commit into
matplotlib:masterfrom
eyurtsev:add_guiEvent_to_pickEvent
Feb 18, 2015
Merged

added guiEvent to PickEvent#4121
tacaswell merged 1 commit into
matplotlib:masterfrom
eyurtsev:add_guiEvent_to_pickEvent

Conversation

@eyurtsev

Copy link
Copy Markdown
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
Copy Markdown
Member

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

👍 from me.

@blink1073

Copy link
Copy Markdown
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.

3 participants