Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9cf717f

Browse files
committed
MNT: simplify deprecation of axis_bg_color
- the decorator takes care of the warning - fall back got get/set_facecolor instead of private internal state
1 parent 058eea7 commit 9cf717f

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2714,7 +2714,7 @@ def set_axis_on(self):
27142714
@cbook.deprecated('2.0', alternative='get_facecolor')
27152715
def get_axis_bgcolor(self):
27162716
"""Return the axis background color"""
2717-
return self._facecolor
2717+
return self.get_facecolor()
27182718

27192719
@cbook.deprecated('2.0', alternative='set_facecolor')
27202720
def set_axis_bgcolor(self, color):
@@ -2724,12 +2724,7 @@ def set_axis_bgcolor(self, color):
27242724
ACCEPTS: any matplotlib color - see
27252725
:func:`~matplotlib.pyplot.colors`
27262726
"""
2727-
warnings.warn(
2728-
"set_axis_bgcolor is deprecated. Use set_facecolor instead.",
2729-
cbook.mplDeprecation)
2730-
self._facecolor = color
2731-
self.patch.set_facecolor(color)
2732-
self.stale = True
2727+
return self.set_facecolor(color)
27332728
# data limits, ticks, tick labels, and formatting
27342729

27352730
def invert_xaxis(self):

0 commit comments

Comments
 (0)