-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Doc]: Better document Axes.transData and other transXYZ attributes #25220
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 think using a pattern like in #25187 to document class attributes (defaulting to |
That pattern would work but feels a bit contrived. The class attributes are None and exist only for the purpose of documentation. Upon instance initialization they are immediately shadowed by instance attributes. I'm leaning towards turning these into properties, because they are read-only. |
Better docs for the transforms would be great but fwiw I’m fairly certain the insights page counts all searches and then labels them with the most recent search, rather than showing the count for a specific query. |
I would like to take up this issue |
Properties probably make sense, especially if we want setting to be private behavior... In the alternative, I do think that if we want to go the "class attribute" route, I'm not super happy with class AxesBase(...):
...
transData: Transform
"""Docstring"""
... This is a declaration that |
maybe it is acceptable to initialize transData some default Transform-object ? |
I think in order to document all the attributes, we need to create a new issue |
I have updated this issue to cover all the transfrom attributes. |
Do you have any ideas how to document this?
But I'm afraid that in this case the clarity of the documentation will suffer Or I can initialize transXYZ with default values (I don't quite understand what values to initialize them with) |
You should make the current attribute private
|
Documentation Link
No response
Problem
It's documented in the tutorial https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html#data-coordinates, but not very discoverable:
https://github.com/matplotlib/matplotlib/graphs/traffic
Problem:
transData
and the likes are only attributes set in a [private function]/(matplotlib/lib/matplotlib/axes/_base.py
Line 910 in 39070ae
As such, they do not have a docstring and do not appear in the API documentation.
Suggested improvement
Action: Find out, how to make this available in the API docs at https://github.com/matplotlib/matplotlib/blob/main/doc/api/axes_api.rst
Worth checking:
Alternative: Turn the
trans*
attributes into properties. They can be documented properly and have the advantage of being read-only. This is a slight performance cost, but should be negligible compared to any action involving the transforms.The text was updated successfully, but these errors were encountered: