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

Connect the Resize Event for WebAgg #3969

Merged
merged 1 commit into from Jan 6, 2015

Conversation

blink1073
Copy link
Member

Add a simple call that enables the resize event. 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('resize_event', on_event)
plt.show()

@blink1073 blink1073 changed the title Coonect the Resize Event for WebAgg Connect the Resize Event for WebAgg Jan 6, 2015
tacaswell added a commit that referenced this pull request Jan 6, 2015
BUG : Connect the Resize Event for WebAgg
@tacaswell tacaswell merged commit c2c2b4d into matplotlib:master Jan 6, 2015
tacaswell added a commit that referenced this pull request Jan 6, 2015
BUG : Connect the Resize Event for WebAgg
@tacaswell
Copy link
Member

back-ported as 433bf76

@pelson
Copy link
Member

pelson commented Jan 6, 2015

That was simple! Nice work @blink1073.

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