-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Improve docstring of Axes.barbs #14256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
lib/matplotlib/quiver.py
Outdated
can be easily distinguished from barbs with a single full line. The | ||
magnitude for the barb shown above would nominally be 65, using the | ||
standard increments of 50, 10, and 5. | ||
flip_barb : bool, default: False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please leave the part about taking an array of bools—that’s an intended feature. While it doesn’t work right now I’m putting in a PR to make it work as the very next thing I code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since I would like to target this doc change to 3.1.1, I'd prefer to describe the behavior as is.I assume that the array handling will go into 3.2.
Additionally, IMHO the section should be rewritten anyway; and I'm not sure about the implementation details (in particular accepting 1D or 2D).
You can easily add the docs to your PR. It's really not much more than
flip_barb : bool or array-like of bool, default: False
[existing doc]
A single value applies to all barbs. Individual barbs can be flipped by
passing a bool array of the same size as *U* and *V*.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I want the fix for the arrays to go in 3.1.1--because right now it'd be a bugfix for documented behavior. I don't want to wait for 3.2 for it as a feature.
#14296 submitted with code to make |
@dopplershift I've updated the docs on |
01d2760
to
5863546
Compare
Call signatures:: | ||
Call signature:: | ||
|
||
barbs([X, Y], U, V, [C], **kw) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this notation un-ambiguously specify that three args means U, V, C
and four args means X, Y, U, V
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say so: Every square bracket is optional.
The resulting three and four argument forms make it unambiguous. This is not much different than https://matplotlib.org/devdocs/api/_as_gen/matplotlib.axes.Axes.pcolormesh.html allowing only one or three arguments.
…256-on-v3.1.x Backport PR #14256 on branch v3.1.x (Improve docstring of Axes.barbs)
PR Summary
As part of #10148: Docstring update for
Axes.barbs
.