Skip to content

Improve docstring of Axes.spy #11366

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 5, 2018
Merged

Conversation

timhoffm
Copy link
Member

@timhoffm timhoffm commented Jun 1, 2018

PR Summary

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

axes.
- 'equal': Ensures an aspect ratio of 1. Pixels will be square
(unless pixel sizes are explicitly made non-square in data
coordinates using *extent*).

Choose a reason for hiding this comment

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

You cannot use extent on spy (not sure if you should, though).


If *marker* and *markersize* are *None*, useful kwargs include:
For the image style, you can pass any parameters supported by
`~.Axes.imshow`. Commonly used parameters include *cmap* and
Copy link
Member

Choose a reason for hiding this comment

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

Not true, you cannot pass extent. You can also not pass interpolation.

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've changed this to a whitelist of just a very few parameters. Note that #11367 will raise a TypeError for the above mentioned cases. Other imshow() parameters are technically allowed, but don't make sense for plotting a sparsity pattern. They are just not mentioned. I'm unsure if one should pohibit them explicitly by raising a TypeError as well. For now, I don't see the neccessity and that would be beyond this PR anyway, which is strictly docstring-only.

* *alpha*
For the marker style, you can pass any parameters
supported by `~.Axes.plot. Commonly used parameters include
*color*, *marker* and *markersize*.

Choose a reason for hiding this comment

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

You cannot pass linestyle.

Also marker and markersize are already arguments of spy, so one wouldn't list them as "Additional Parameters" as well,right?

@phobson phobson merged commit 55f8907 into matplotlib:master Jun 5, 2018
@timhoffm timhoffm added this to the v3.0 milestone Jun 5, 2018
@timhoffm timhoffm deleted the doc-axes-spy branch June 5, 2018 19:33
@timhoffm
Copy link
Member Author

timhoffm commented Jun 5, 2018

@meeseeksdev backport to v2.2.x

@matplotlib matplotlib deleted a comment from lumberbot-app bot Jun 5, 2018
@lumberbot-app
Copy link

lumberbot-app bot commented Jun 5, 2018

There seem to be a conflict, please backport manually

@adamjstewart
Copy link
Contributor

It looks like the docs for matplotlib.pyplot.spy and matplotlib.axes.Axes.spy are messed up. All rST formatting has been removed and most of the docs are formatted in bold. Is this why the commit needs to be backported?

@ImportanceOfBeingErnest
Copy link
Member

Correct. But you can already view the improved version here.

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.

5 participants