Skip to content

DOC: setting active axes position is ineffective#31314

Open
rcomer wants to merge 1 commit intomatplotlib:mainfrom
rcomer:set_position-active-doc
Open

DOC: setting active axes position is ineffective#31314
rcomer wants to merge 1 commit intomatplotlib:mainfrom
rcomer:set_position-active-doc

Conversation

@rcomer
Copy link
Member

@rcomer rcomer commented Mar 16, 2026

PR summary

Closes #31254. I do not have any evidence that this matters for third party subclasses, but it is a possibility. Since we only pass the parameter down, I think continuing to support it indefinitely is likely less maintenance work than deprecating it.

AI Disclosure

None

PR checklist

@rcomer rcomer added Documentation: API files in lib/ and doc/api and removed topic: axes labels Mar 16, 2026
Comment on lines +1179 to +1183
For native Matplotlib `.Axes`, the active position is
determined by a combination of the original position and the
aspect ratio. Setting the active position directly is
therefore not effective. This option is retained as it may be
relevant for some third party `.Axes` subclasses.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some similarity to https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.apply_aspect.html#matplotlib.axes.Axes.apply_aspect and more specific explanation.

Suggested change
For native Matplotlib `.Axes`, the active position is
determined by a combination of the original position and the
aspect ratio. Setting the active position directly is
therefore not effective. This option is retained as it may be
relevant for some third party `.Axes` subclasses.
This parameter is considered internal. End users should not use it.
For native Matplotlib `.Axes`, the active position is
determined by a combination of the original position and the
aspect ratio. Setting the active position only is only meaningful
in the context of correct internal state, which is managed
internally inside `.Axes`. This option is retained as it may be
relevant for some third party `.Axes` subclasses.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting the active position only is only meaningful in the context of correct internal state, which is managed internally inside .Axes.

I'm sorry but I'm not following this sentence. I'm happy with the rest.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed it's a bit convoluted. What I want to say is that position="active" requires does have an effect - as opposed to being ineffective. But you cannot set arbitrary values with position="active", they must be consistent with the internal state (specifically the position should be the one derived from the original position and aspect calculation, otherwise surprising things like other Axes overlapping or change through a updated aspect calculation may happen.) Simpler wording welcome.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Any active position set by the user will therefore be overwritten by internal handling"

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation: API files in lib/ and doc/api

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MNT]: deprecate "which" parameter of Axes.set_position?

2 participants