-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Doc]: How to replicate behaviour of plt.gca(projection=...)
?
#20770
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
Comments
I guess you are looking for is something like |
Do we remember when this came in. I'm pretty sure we discussed this issue. |
OK, this was #19153 and had a pretty long deprecation message, if I understand correctly. Was the deprecation message not showing up for @dsantsby, can you explain more your use case here? I guess I can see that one might organize one's axes this way, but it seems very ad-hoc to create a new polar axes unless one already exists, and in that case use the existing axes. Over all we are really trying to move away from state-based thinking, and this is a pretty extreme example. |
The deprecation message is showing up for My use case is a plot method in another library, which when called with no specified Axes I want to:
The reason I can't use
This is fair, but there's nothing in the what's new changelog entry explaining this or discouraging users. So I think there should either be a clear explanation to this effect explaining why
|
Documentation Link
https://matplotlib.org/stable/users/whats_new.html#changes-to-behavior-of-axes-creation-methods-gca-add-axes-add-subplot
Problem
In version 3.4, passing keyword arguments to
plt.gca()
was deprecated. I was previously usingplt.gca(projection='polar')
to:Looking at the documentation (https://matplotlib.org/stable/users/whats_new.html#changes-to-behavior-of-axes-creation-methods-gca-add-axes-add-subplot) it's not clear to me how to replicate this behaviour however. In pseudo-code I think what I want to do is:
The only thing I don't know how to get is a list of pyplot axes (
pyplot_axes
above). I looked at https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.html and didn't see anything, but perhaps there's another page I'm missing?Suggested improvement
Add a clear description to the changelog (https://matplotlib.org/stable/users/whats_new.html#changes-to-behavior-of-axes-creation-methods-gca-add-axes-add-subplot) showing how to write code to reproduce
plt.gca(projection=...)
.Matplotlib Version
3.4.2
Matplotlib documentation version
3.4.2
The text was updated successfully, but these errors were encountered: