Skip to content

Commit c6407b1

Browse files
committed
deprecate unknown kwargs in Axes.stem
1 parent 1682db7 commit c6407b1

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
import matplotlib.transforms as mtransforms
4040
import matplotlib.tri as mtri
4141
from matplotlib.cbook import (
42-
_backports, mplDeprecation, STEP_LOOKUP_MAP, iterable, safe_first_element)
42+
_backports, mplDeprecation, warn_deprecated,
43+
STEP_LOOKUP_MAP, iterable, safe_first_element)
4344
from matplotlib.container import BarContainer, ErrorbarContainer, StemContainer
4445
from matplotlib.axes._base import _AxesBase, _process_plot_format
4546

@@ -2473,6 +2474,16 @@ def stem(self, *args, linefmt=None, markerfmt=None, basefmt=None, bottom=0,
24732474
which inspired this method.
24742475
24752476
"""
2477+
if kwargs:
2478+
# TODO: to remove the deprecated behavior, simply remove **kwargs
2479+
# from the function signature and remove this warning.
2480+
warn_deprecated(since='2.2',
2481+
message = "stem() got an unexpected keyword "
2482+
"argument '%s'. This will raise a "
2483+
"TypeError in future versions." % (
2484+
next(k for k in kwargs), )
2485+
)
2486+
24762487
remember_hold = self._hold
24772488
if not self._hold:
24782489
self.cla()

0 commit comments

Comments
 (0)