Skip to content

Commit

Permalink
Fix dpi option in ggplot.save method
Browse files Browse the repository at this point in the history
  • Loading branch information
yejianye authored and has2k1 committed Aug 29, 2017
1 parent 2b5c89f commit 833ecf2
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions plotnine/ggplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,17 +541,13 @@ def save(self, filename=None, format=None, path=None,
"not pixels). If you are sure you want these "
"dimensions, use 'limitsize=False'.".format(width, height))

# dpi
if dpi is None:
try:
dpi = self.theme.themeables.property('dpi')
self.theme.themeables.property('dpi')
except KeyError:
dpi = 100
# Do not modify original
self.theme = copy(self.theme) + theme(dpi=dpi)

# Should not need this with MPL 2.0
fig_kwargs['dpi'] = dpi
self.theme = self.theme + theme(dpi=100)
else:
self.theme = self.theme + theme(dpi=dpi)

if verbose:
warn("Saving {0} x {1} {2} image.".format(
Expand Down

0 comments on commit 833ecf2

Please sign in to comment.