Tweak secondary_{x,y}axis docs.#31405
Conversation
jklymak
left a comment
There was a problem hiding this comment.
Small suggestion though I wonder if this is even an example or the by far predominant use
lib/matplotlib/axes/_axes.py
Outdated
|
|
||
| For example if we want to have a second scale for the data plotted on | ||
| the xaxis. | ||
| This axis can e.g. display a second x-scale for the data plotted on the Axes. |
There was a problem hiding this comment.
| This axis can e.g. display a second x-scale for the data plotted on the Axes. | |
| This axis can, for example, display a second x-scale for the data plotted on the Axes. |
There was a problem hiding this comment.
Given the discussion below, I reworded to "is typically used to...". Let me know if you want to stick to "for example".
lib/matplotlib/axes/_axes.py
Outdated
|
|
||
| For example if we want to have a second scale for the data plotted on | ||
| the yaxis. | ||
| This axis can e.g. display a second y-scale for the data plotted on the Axes. |
There was a problem hiding this comment.
| This axis can e.g. display a second y-scale for the data plotted on the Axes. | |
| This axis can, for example, display a second y-scale for the data plotted on the Axes. |
|
I think this is the only use. The secondary axis is coupled to the primary axis through a functional relationship. Side question: Is it ever intended to add data to the Axes created by The "Returns" section could be amended by something like
On a general note, this concept is a bit of a crutch. It would be better to allow secondary Axis objects on Axes instead of creating a full separate Axes instance and hiding everything we don't need. But that'd be a substantial change which we are not going to make any time soon if ever. So the solution is here to stay. It's been marked as experimental since 3.1. I'm fine with keeping that on the basis that it's not a great design, but OTOH it's been around for a long time and we are not likely to change it, so we could as well remove the experimental status. There are about 3k usages (https://github.com/search?q=%2Fsecondary_%5Bxy%5Daxis%5C%28%2F+language%3APython+NOT+is%3Afork&type=code), so it's not too much but also not negligible, so that we may not want to break them even if we technically could due to the experimental status. |
Use a full sentence with a principal clause. Also, the data is not plotted on the x- or y-axis; it is the scale that is on the x- or y-axis.
Use a full sentence with a principal clause. Also, the data is not plotted on the x- or y-axis; it is the scale that is on the x- or y-axis.
PR summary
AI Disclosure
PR checklist