FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix passing stem markerfmt positionally when locs are not given by timhoffm · Pull Request #23232 · matplotlib/matplotlib · GitHub

Repository navigation

Fix passing stem markerfmt positionally when locs are not given - #23232

Merged
tacaswell merged 1 commit into
matplotlib:mainfrom
timhoffm:stem-fmt
Jun 17, 2022
Merged

tacaswell merged 1 commit into
matplotlib:mainfrom
timhoffm:stem-fmt

Conversation

timhoffm commented Jun 9, 2022 •
edited
Loading

Copy link
Copy Markdown
Member

the signature is stem([locs], heads, linefmt=None, ...)

So we should support both:

stem(heads, linefmt='r')
stem(heads, 'r')

We had a kwonly deprecation for 3.5 that was aiming at
stem([locs], heads, *, linefmt=None, ...)
but now I'd rather relax this to
stem([locs], heads, linefmt=None, *, ...)
because it's reasonable to still support stem(heads, 'r'). That's
analogous to plot(y, 'r'). The code overhead for supporting both
positional and keyword passing for the single linefmt parameter
is bearable.

timhoffm added this to the v3.5.3 milestone Jun 9, 2022
timhoffm added PR: bugfix Pull requests that fix identified bugs API: changes Changes to the public API, typically requiring deprecation. labels Jun 9, 2022
_assert_equal(ax.stem(x, y, linefmt='r--'), expected=(x, y))
_assert_equal(ax.stem(x, y, linefmt='r--', basefmt='b--'), expected=(x, y))
_assert_equal(ax.stem(y, linefmt='r--'), expected=([0, 1, 2], y))
_assert_equal(ax.stem(y, 'r--'), expected=([0, 1, 2], y))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Test somewhere that the lines actually are red and dashed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'll do that as part of #23233:
f2f168e

timhoffm force-pushed the stem-fmt branch 2 times, most recently from 78b881e to 3ac90b0 Compare June 10, 2022 18:49
the signature is stem([locs], heads, linefmt=None, ...)

So we should support both:

```
stem(heads, linefmt='r')
stem(heads, 'r')
```

We had a kwonly deprecation for 3.5 that was aiming at
`stem([locs], heads, *, linefmt=None, ...)`
but now I'd rather relax this to
`stem([locs], heads, linefmt=None, *, ...)`
because it's reasonable to still support `stem(heads, 'r')`. That's
analogous to `plot(y, 'r')`. The code overhead for supporting both
positional and keyword passing for the single `linefmt` parameter
is bearable.
tacaswell merged commit 3e9f0b8 into matplotlib:main Jun 17, 2022
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jun 17, 2022
timhoffm deleted the stem-fmt branch June 17, 2022 06:58
QuLogic pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jun 21, 2022
timhoffm added a commit that referenced this pull request Jun 21, 2022
…232-on-v3.5.x

Backport PR #23232 on branch v3.5.x (Fix passing stem markerfmt positionally when locs are not given)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API: changes Changes to the public API, typically requiring deprecation. PR: bugfix Pull requests that fix identified bugs topic: stem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL