Skip to content

Commit 3711871

Browse files
committed
Merge pull request #6197 from tacaswell/interactive_save
Fixed interactive save to use rcParams for facecolor and edgecolor.
2 parents 8dc7091 + 54185a8 commit 3711871

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2078,7 +2078,7 @@ def _get_output_canvas(self, format):
20782078
'Supported formats: '
20792079
'%s.' % (format, ', '.join(formats)))
20802080

2081-
def print_figure(self, filename, dpi=None, facecolor='w', edgecolor='w',
2081+
def print_figure(self, filename, dpi=None, facecolor=None, edgecolor=None,
20822082
orientation='portrait', format=None, **kwargs):
20832083
"""
20842084
Render the figure to hardcopy. Set the figure patch face and edge
@@ -2098,10 +2098,10 @@ def print_figure(self, filename, dpi=None, facecolor='w', edgecolor='w',
20982098
the dots per inch to save the figure in; if None, use savefig.dpi
20992099
21002100
*facecolor*
2101-
the facecolor of the figure
2101+
the facecolor of the figure; if None, defaults to savefig.facecolor
21022102
21032103
*edgecolor*
2104-
the edgecolor of the figure
2104+
the edgecolor of the figure; if None, defaults to savefig.edgecolor
21052105
21062106
*orientation*
21072107
landscape' | 'portrait' (not supported on all backends)
@@ -2141,9 +2141,15 @@ def print_figure(self, filename, dpi=None, facecolor='w', edgecolor='w',
21412141

21422142
if dpi is None:
21432143
dpi = rcParams['savefig.dpi']
2144+
21442145
if dpi == 'figure':
21452146
dpi = self.figure.dpi
21462147

2148+
if facecolor is None:
2149+
facecolor = rcParams['savefig.facecolor']
2150+
if edgecolor is None:
2151+
edgecolor = rcParams['savefig.edgecolor']
2152+
21472153
origDPI = self.figure.dpi
21482154
origfacecolor = self.figure.get_facecolor()
21492155
origedgecolor = self.figure.get_edgecolor()

0 commit comments

Comments
 (0)