Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 99c8278

Browse filesBrowse files
committed
minor tweak to pyplot.savefig to ensure that if transparent=True
is passed to `savefig`, the patch colors are restored on the screen after saving.
1 parent 10f2b0e commit 99c8278
Copy full SHA for 99c8278

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed

‎lib/matplotlib/pyplot.py

Copy file name to clipboardExpand all lines: lib/matplotlib/pyplot.py
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,9 @@ def draw():
563563
@docstring.copy_dedent(Figure.savefig)
564564
def savefig(*args, **kwargs):
565565
fig = gcf()
566-
return fig.savefig(*args, **kwargs)
566+
res = fig.savefig(*args, **kwargs)
567+
draw() # need this if 'transparent=True' to reset colors
568+
return res
567569

568570

569571
@docstring.copy_dedent(Figure.ginput)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.