8000 Backend refactor qt by tacaswell · Pull Request #5 · OceanWolf/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Backend refactor qt #5

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

Open
wants to merge 10 commits into
base: backend-refactor
Choose a base branch
from
Prev Previous commit
Next Next commit
Quick fix to figure for safe unpickling.
  • Loading branch information
OceanWolf committed Feb 26, 2015
commit 61a709039d7e270771bf7845f9e7c43a120f6f9f
11 changes: 9 additions & 2 deletions lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1358,11 +1358,18 @@ def __setstate__(self, state):

if restore_to_pylab:
# lazy import to avoid circularity
# XXX clean on removal of Gcf from backends
import matplotlib.pyplot as plt
import matplotlib._pylab_helpers as pylab_helpers
import matplotlib.backend_managers as managers
allnums = plt.get_fignums()
num = max(allnums) + 1 if allnums else 1
mgr = plt._backend_mod.new_figure_manager_given_figure(num, self)
if managers.old_new_figure_manager:
mgr = plt._backend_mod.new_figure_manager_given_figure(num,
self)
mgr.mainloop = plt._show
else:
mgr = managers.new_figure_manager_given_figure(num, self)

# XXX The following is a copy and paste from pyplot. Consider
# factoring to pylab_helpers
Expand All @@ -1377,7 +1384,7 @@ def make_active(event):
mgr._cidgcf = mgr.canvas.mpl_connect('button_press_event',
make_active)

pylab_helpers.Gcf.set_active(mgr)
pylab_helpers.Gcf.add_figure_manager(mgr)
self.number = num

plt.draw_if_interactive()
Expand Down
0