-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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
Conversation
lib/matplotlib/axes/_axes.py
Outdated
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*). |
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.
You cannot use extent
on spy (not sure if you should, though).
lib/matplotlib/axes/_axes.py
Outdated
|
||
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 |
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.
Not true, you cannot pass extent
. You can also not pass interpolation
.
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'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.
lib/matplotlib/axes/_axes.py
Outdated
* *alpha* | ||
For the marker style, you can pass any parameters | ||
supported by `~.Axes.plot. Commonly used parameters include | ||
*color*, *marker* and *markersize*. |
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.
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?
@meeseeksdev backport to v2.2.x |
There seem to be a conflict, please backport manually |
It looks like the docs for |
Correct. But you can already view the improved version here. |
PR Summary
As part of #10148: Docstring update for
Axes.spy
.