Skip to content

Commit

Permalink
FIX: always normalize dpi
Browse files Browse the repository at this point in the history
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 matplotlib#6113
  • Loading branch information
tacaswell committed May 22, 2016
1 parent 6f52ee0 commit ff7a04e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/matplotlib/animation.py
Expand Up @@ -755,8 +755,8 @@ def save(self, filename, writer=None, fps=None, dpi=None, codec=None,
# Re-use the savefig DPI for ours if none is given
if dpi is None:
dpi = rcParams['savefig.dpi']
if dpi == 'figure':
dpi = self._fig.dpi
if dpi == 'figure':
dpi = self._fig.dpi

if codec is None:
codec = rcParams['animation.codec']
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/backend_bases.py
Expand Up @@ -2141,8 +2141,8 @@ def print_figure(self, filename, dpi=None, facecolor='w', edgecolor='w',

if dpi is None:
dpi = rcParams['savefig.dpi']
if dpi == 'figure':
dpi = self.figure.dpi
if dpi == 'figure':
dpi = self.figure.dpi

origDPI = self.figure.dpi
origfacecolor = self.figure.get_facecolor()
Expand Down

0 comments on commit ff7a04e

Please sign in to comment.