Skip to content

Commit

Permalink
PRF: prevent possible over draws
Browse files Browse the repository at this point in the history
Set the `_is_saving` flag as early as possible in `print_figure`
to prevent aggressive auto-drawing during the same process.
  • Loading branch information
tacaswell committed Sep 26, 2015
1 parent 77e815e commit 644b4b2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/matplotlib/backend_bases.py
Expand Up @@ -2123,6 +2123,8 @@ def print_figure(self, filename, dpi=None, facecolor='w', edgecolor='w',
tight bbox is calculated.
"""
self._is_saving = True

if format is None:
# get format from filename, or from backend's default filetype
if cbook.is_string_like(filename):
Expand Down Expand Up @@ -2216,7 +2218,6 @@ def print_figure(self, filename, dpi=None, facecolor='w', edgecolor='w',
else:
_bbox_inches_restore = None

self._is_saving = True
try:
#result = getattr(self, method_name)(
result = print_method(
Expand Down

0 comments on commit 644b4b2

Please sign in to comment.