Skip to content

Fixed interactive save to use rcParams for facecolor and edgecolor. #6197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 23, 2016
Merged
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
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