8000 PRF: prevent possible over draws · matplotlib/matplotlib@644b4b2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 644b4b2

Browse files
committed
PRF: prevent possible over draws
Set the `_is_saving` flag as early as possible in `print_figure` to prevent aggressive auto-drawing during the same process.
1 parent 77e815e commit 644b4b2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 2 additions & 1 deletion
7F20
Original file line numberDiff line numberDiff line change
@@ -2123,6 +2123,8 @@ def print_figure(self, filename, dpi=None, facecolor='w', edgecolor='w',
21232123
tight bbox is calculated.
21242124
21252125
"""
2126+
self._is_saving = True
2127+
21262128
if format is None:
21272129
# get format from filename, or from backend's default filetype
21282130
if cbook.is_string_like(filename):
@@ -2216,7 +2218,6 @@ def print_figure(self, filename, dpi=None, facecolor='w', edgecolor='w',
22162218
else:
22172219
_bbox_inches_restore = None
22182220

2219-
self._is_saving = True
22202221
try:
22212222
#result = getattr(self, method_name)(
22222223
result = print_method(

0 commit comments

Comments
 (0)
0