Skip to content

Commit

Permalink
Fixed interactive save to use rcParams for facecolor and edgecolor.
Browse files Browse the repository at this point in the history
  • Loading branch information
u55 authored and bearstrong committed Apr 1, 2016
1 parent ae05690 commit 7e209a2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -2078,7 +2078,7 @@ def _get_output_canvas(self, format):
'Supported formats: '
'%s.' % (format, ', '.join(formats)))

def print_figure(self, filename, dpi=None, facecolor='w', edgecolor='w',
def print_figure(self, filename, dpi=None, facecolor=None, edgecolor=None,
orientation='portrait', format=None, **kwargs):
"""
Render the figure to hardcopy. Set the figure patch face and edge
Expand All @@ -2098,10 +2098,10 @@ def print_figure(self, filename, dpi=None, facecolor='w', edgecolor='w',
the dots per inch to save the figure in; if None, use savefig.dpi
*facecolor*
the facecolor of the figure
the facecolor of the figure; if None, defaults to savefig.facecolor
*edgecolor*
the edgecolor of the figure
the edgecolor of the figure; if None, defaults to savefig.edgecolor
*orientation*
landscape' | 'portrait' (not supported on all backends)
Expand Down Expand Up @@ -2141,9 +2141,15 @@ 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 facecolor is None:
facecolor = rcParams['savefig.facecolor']
if edgecolor is None:
edgecolor = rcParams['savefig.edgecolor']

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

0 comments on commit 7e209a2

Please sign in to comment.