Skip to content

Commit

Permalink
Fix FigureManager to allow pyplot to work for non GUI backends
Browse files Browse the repository at this point in the history
  • Loading branch information
OceanWolf committed Jul 27, 2015
1 parent 2e3fa8c commit cc0d4cd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/matplotlib/backend_managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def __init__(self, figure, num, **kwargs):

self._is_gui = hasattr(self._backend, 'Window')
if not self._is_gui:
self.window = None
return

self._mainloop = self._backend.MainLoop()
Expand Down Expand Up @@ -185,7 +186,8 @@ def set_window_title(self, title):
Set the title text of the window containing the figure. Note that
this has no effect for non-GUI backends (e.g., a PS backend).
"""
self.window.set_window_title(title)
if self.window:
self.window.set_window_title(title)

@property
def backend(self):
Expand Down

0 comments on commit cc0d4cd

Please sign in to comment.