X Tutup
Skip to content

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

@rcomer

Description

@rcomer

Summary

As a user, I was always confused by the which parameter of set_position and under what circumstance one might set the active position. The docstring indicates that the original and active positions are usually the same unless a fixed aspect ratio is set.

Looking through the code of apply_aspect, I think it always updates the active position. Since apply_aspect gets called within draw, get_tightbbox and get_position, it's not clear to me that the user can ever effectively set the active position directly, unless they made an axes subclass that replaced apply_aspect.

apply_aspect itself uses a private _set_position that was factored out of set_position at #9082. So maybe the existence of the which parameter in the public function is a hangover from before that and is no longer needed.

Proposed fix

Either deprecate the which parameter in the public method so it only sets the original position, or make it clear in the docstring that setting the active position will almost never be effective.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup