Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9e34497

Browse files
committed
FIX: fix up savefig dpi if scaled for screen
If `_original_dpi` is tacked on to the figure instance by a backend canvas use that for 'figure' dpi instead of the dpi scaled for the screen.
1 parent 9c948dd commit 9e34497

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2157,7 +2157,7 @@ def print_figure(self, filename, dpi=None, facecolor=None, edgecolor=None,
21572157
dpi = rcParams['savefig.dpi']
21582158

21592159
if dpi == 'figure':
2160-
dpi = self.figure.dpi
2160+
dpi = getattr(self.figure, '_orginal_dpi', self.figure.dpi)
21612161

21622162
if facecolor is None:
21632163
facecolor = rcParams['savefig.facecolor']

0 commit comments

Comments
 (0)