8000 Improve docstring of Axes.barbs by timhoffm · Pull Request #14256 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 1 commit into from
Jun 10, 2019
Merged

Conversation

timhoffm
Copy link
Member

PR Summary

As part of #10148: Docstring update for Axes.barbs.

@timhoffm timhoffm added this to the v3.1.1 milestone May 18, 2019
@QuLogic QuLogic requested a review from dopplershift May 18, 2019 21:44
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
Copy link
Contributor

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.

Copy link
Member Author
@timhoffm timhoffm May 19, 2019

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*.

Copy link
Contributor

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.

@dopplershift
Copy link
Contributor
dopplershift commented May 21, 2019

#14296 submitted with code to make flip_barb work for arrays.

@timhoffm
Copy link
Member Author

@dopplershift I've updated the docs on flip_barbs.

@timhoffm timhoffm force-pushed the doc-barbs branch 2 times, most recently from 01d2760 to 5863546 Compare May 24, 2019 20:53
Call signatures::
Call signature::

barbs([X, Y], U, V, [C], **kw)
Copy link
Member

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?

Copy link
Member Author

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.

@tacaswell tacaswell merged commit 476e0c2 into matplotlib:master Jun 10, 2019
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jun 10, 2019
timhoffm added a commit that referenced this pull request Jun 10, 2019
…256-on-v3.1.x

Backport PR #14256 on branch v3.1.x (Improve docstring of Axes.barbs)
@timhoffm timhoffm deleted the doc-barbs branch June 10, 2022 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0