Skip to content

Commit 99a681e

Browse files
authored
Merge pull request #21169 from meeseeksmachine/auto-backport-of-pr-21126-on-v3.5.x
Backport PR #21126 on branch v3.5.x (Deprecate passing formatting parameters positionally to stem())
2 parents f090ba6 + 85496e7 commit 99a681e

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Passing formatting parameters positionally to ``stem()`` is deprecated
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

lib/matplotlib/axes/_axes.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2849,6 +2849,12 @@ def stem(self, *args, linefmt=None, markerfmt=None, basefmt=None, bottom=0,
28492849
args = ()
28502850
else:
28512851
locs, heads, *args = args
2852+
if args:
2853+
_api.warn_deprecated(
2854+
"3.5",
2855+
message="Passing the linefmt parameter positionally is "
2856+
"deprecated since Matplotlib %(since)s; the "
2857+
"parameter will become keyword-only %(removal)s.")
28522858

28532859
if orientation == 'vertical':
28542860
locs, heads = self._process_unit_info([("x", locs), ("y", heads)])

lib/matplotlib/tests/test_axes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3642,16 +3642,16 @@ def test_stem_args():
36423642
# Test the call signatures
36433643
ax.stem(y)
36443644
ax.stem(x, y)
3645-
ax.stem(x, y, 'r--')
3646-
ax.stem(x, y, 'r--', basefmt='b--')
3645+
ax.stem(x, y, linefmt='r--')
3646+
ax.stem(x, y, linefmt='r--', basefmt='b--')
36473647

36483648

36493649
def test_stem_dates():
36503650
fig, ax = plt.subplots(1, 1)
36513651
xs = [dateutil.parser.parse("2013-9-28 11:00:00"),
36523652
dateutil.parser.parse("2013-9-28 12:00:00")]
36533653
ys = [100, 200]
3654-
ax.stem(xs, ys, "*-")
3654+
ax.stem(xs, ys)
36553655

36563656

36573657
@pytest.mark.parametrize("use_line_collection", [True, False],

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy