Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9cf717f

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 parent058eea7 commit9cf717f

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
defget_axis_bgcolor(self):
27162716
"""Return the axis background color"""
2717-
returnself._facecolor
2717+
returnself.get_facecolor()
27182718

27192719
@cbook.deprecated('2.0',alternative='set_facecolor')
27202720
defset_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+
returnself.set_facecolor(color)
27332728
# data limits, ticks, tick labels, and formatting
27342729

27352730
definvert_xaxis(self):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp