DOC: clarify that secondary_[xy]axis returns an Axes subclass#28953
DOC: clarify that secondary_[xy]axis returns an Axes subclass#28953rcomer wants to merge 1 commit intomatplotlib:mainfrom
Conversation
|
Not necessarily to be done in this PR, but the docstring should be substantially enhanced to explain what this is for and how it works, some points are:
Not sure to mention it, but IMHO the implementation as child Axes is a workaround implementation detail. A possibly cleaner, more general approach would be to support multiple axises on one Axes object. |
If I recall, the main reason it is an Axes rather than an Axis, is that Axis does not have the concept of an x/ylabel - that is an Axes property. Similarly I think there are numerous tick conveniences on Axes that are less easy on Axis. Not to say one couldn't come up with an API for multiple xlabels etc, but simplest was just a child Axes. |
|
While pragmatism tells me to merge this, this feels wrong. While we interpret type fields loosely target towards readability (instead of formal type specifications), the type field is not the place for context information. The minimal solution would be to move that to the description. OTOH, the underlying problem is that |
|
Fair enough. I don't really have bandwidth to propose a better change right now, so let's just close this. |
|
I've created #29004 as a reminder. Will care for it, when there is time. |
PR summary
I had expected
secondary_xaxisto return something that behaves likeXAxis, so was surprised to getPR checklist