8000 FIX: always normalize dpi · matplotlib/matplotlib@259483a · GitHub
[go: up one dir, main page]

Skip to content

Commit 259483a

Browse files
committed
FIX: always normalize dpi
The string 'figure' is a valid value for dpi. Always check if this is the input, not just if we look it up from the rcparams. closes #6113
1 parent b89ddd3 commit 259483a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/matplotlib/animation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,8 +755,8 @@ def save(self, filename, writer=None, fps=None, dpi=None, codec=None,
755755
# Re-use the savefig DPI for ours if none is given
756756
if dpi is None:
757757
dpi = rcParams['savefig.dpi']
758-
if dpi == 'figure':
759-
dpi = self._fig.dpi
758+
if dpi == 'figure':
759+
dpi = self._fig.dpi
760760

761761
if codec is None:
762762
codec = rcParams['animation.codec']

lib/matplotlib/backend_bases.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2141,8 +2141,8 @@ def print_figure(self, filename, dpi=None, facecolor='w', edgecolor='w',
21412141

21422142
if dpi is None:
21432143
dpi = rcParams['savefig.dpi']
2144-
if dpi == 'figure':
2145-
dpi = self.figure.dpi
2144+
if dpi == 'figure':
2145+
dpi = self.figure.dpi
21462146

21472147
origDPI = self.figure.dpi
21482148
origfacecolor = self.figure.get_facecolor()

0 commit comments

Comments
 (0)
0