-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
DOC: Improve module docs of matplotlib.scale #29353
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
7c82a2a
to
fe238da
Compare
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.
Couple of small suggestions you can take or leave.
lib/matplotlib/scale.py
Outdated
|
||
See also `.axes.Axes.set_xscale` and the scales examples in the documentation. | ||
Scales are subclasses `ScaleBase`. Their mapping is implemented through `.Transform` |
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.
This is pretty technical for right at the top? Maybe down around the new L26 would be better?
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 reduced to
The mapping is implemented through
.Transform
subclasses.
Because that's context needed to understand why the transform columns in the subsequent table exist.
I agree that the technical details are not relevant for users. They are basically only needed when you want to implement your own scales. That information is (although not very concise) available in the ScaleBase
docstring and the Custom scale example. Therefore we can leave it out of the introductory paragraph. I may later improve the custom scale example. But that's a separate topic.
lib/matplotlib/scale.py
Outdated
|
||
Custom scaling can be achieved through `FuncScale`, or by creating your own | ||
`ScaleBase` subclass (see :doc:`/gallery/scales/custom_scale`). | ||
Third parties can register their scales by name through `register_scale`. | ||
|
||
Matplotlib also supports non-separable transformations that operate on both |
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 find this sentence pretty confusing on its own. Appreciate you are just changing the formatting here, but if we are improving things, we might mention that the previous scales act on one axis at a time, and are for Cartesian axes.
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.
, and are for Cartesian axes.
This is not quite true, you can e.g set a log radial axis in a polar plot.
I'm tempted to leave out the paragraph. I think that scales and projections are mostly independent of each other (but am not completely sure).
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.
Ok fair enough. Maybe "scales are typically applied individually to the axis of a separable axes. Non-separable axes are dealt with using projections". But maybe you are correct that you could do without it here.
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 removed that paragraph. Irrespective of the exact technical relationship. People looking at scales will typically have a certain projection (mostly cartesian axes) in mind and only consider the scaling behavior along the given axes. It's likely not helpful for them to bring up the topic of other projections here.
…353-on-v3.10.x Backport PR #29353 on branch v3.10.x (DOC: Improve module docs of matplotlib.scale)
No description provided.