Skip to content

Commit

Permalink
Make stem formatting parameters keyword only.
Browse files Browse the repository at this point in the history
This will allow to simplify the implementation because, currently,
`stem(*args, linefmt=None, ...)` still tries to resolve excess
positionally passed args, to *linefmt* and following parameters, which
is quite a bit of logic.

OTOH, since we have 3 formats, passing them positionally is already
difficult from a usability/readability perspective, because they can
easily be mixed up.
  • Loading branch information
timhoffm committed Sep 19, 2021
1 parent c53216b commit 07cbdfc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/api/next_api_changes/deprecations/21126-TH.rst
@@ -0,0 +1,2 @@
Passing formatting parameters positionally to ``stem()`` is deprecated
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 change: 1 addition & 0 deletions lib/matplotlib/axes/_axes.py
Expand Up @@ -2773,6 +2773,7 @@ def broken_barh(self, xranges, yrange, **kwargs):

return col

@_api.make_keyword_only("3.5", 'linefmt')
@_preprocess_data()
def stem(self, *args, linefmt=None, markerfmt=None, basefmt=None, bottom=0,
label=None, use_line_collection=True, orientation='vertical'):
Expand Down

0 comments on commit 07cbdfc

Please sign in to comment.