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

Add Figure Enter/Leave Events to Webagg #3970

Merged
merged 1 commit into from Jan 6, 2015

Conversation

blink1073
Copy link
Member

To test:

import matplotlib
import itertools
import numpy as np
matplotlib.use('webagg')
import matplotlib.pyplot as plt
plt.close('all')
fig, ax = plt.subplots()
x = np.linspace(0,10,100)
y = np.sin(x)
ln, = ax.plot(x,y, 'o', picker=5)
evt = []
colors = iter(itertools.cycle(['r', 'g', 'b', 'k', 'c']))
def on_event(event):
    evt.append(event)
    ln.set_color(next(colors))
    fig.canvas.draw()
    fig.canvas.draw_idle()
fig.canvas.mpl_connect('figure_enter_event', on_event)
fig.canvas.mpl_connect('figure_leave_event', on_event)
plt.show()

tacaswell added a commit that referenced this pull request Jan 6, 2015
ENH : Add Figure Enter/Leave Events to Webagg
@tacaswell tacaswell merged commit cdb6771 into matplotlib:master Jan 6, 2015
tacaswell added a commit that referenced this pull request Jan 6, 2015
ENH : Add Figure Enter/Leave Events to Webagg
@tacaswell
Copy link
Member

backported as 771664f

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

2 participants