Skip to content

resize_event not working with MacOSX backend #5043

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

Merged
merged 1 commit into from
Sep 11, 2015

Conversation

astrofrog
Copy link
Contributor

Currently resize_event does not work with the MacOS X backend. The following example illustrates the issue:

import matplotlib 
matplotlib.use('MacOSX')
import matplotlib.pyplot as plt 

def on_resize(event): 
    print("resizing")

fig = plt.figure() 
ax = fig.add_subplot(1,1,1)
ax.plot([1,2,3])
fig.canvas.mpl_connect('resize_event', on_resize) 
plt.show() 

when resizing the figure, nothing is printed. If the backend is changed to Qt4Agg, the message is printed as expected. This indicates a backend-specific issue.

cc @mdehoon

@mdehoon
Copy link
Contributor

mdehoon commented Sep 10, 2015

A call to FigureCanvasBase.resize_event(self) is missing at the end of the resize method in FigureCanvasMac in backend_macosx.py. Can you add it?

@astrofrog
Copy link
Contributor Author

@mdehoon - yes, I'll give it a try and open a PR if it works.

…_events to not work in MacOSX backend (fix suggested by @mdehoon)
@astrofrog
Copy link
Contributor Author

@mdehoon - the fixed worked for me and I just made this issue into a pull request.

@tacaswell
Copy link
Member

👍 Looks good to me, one of the mac based devs should merge it.

@tacaswell tacaswell added this to the next point release milestone Sep 10, 2015
mdehoon added a commit that referenced this pull request Sep 11, 2015
resize_event not working with MacOSX backend
@mdehoon mdehoon merged commit 00e381f into matplotlib:master Sep 11, 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