Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -2068,7 +2068,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 @@ -2088,10 +2088,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 @@ -2129,6 +2129,10 @@ def print_figure(self, filename, dpi=None, facecolor='w', edgecolor='w',

if dpi is None:
dpi = rcParams['savefig.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()
Expand Down