Skip to content

Deprecate ContourLabeler.add_label_clabeltext.#26917

Merged
QuLogic merged 1 commit intomatplotlib:mainfrom
anntzer:ct
Oct 3, 2023
Merged

Deprecate ContourLabeler.add_label_clabeltext.#26917
QuLogic merged 1 commit intomatplotlib:mainfrom
anntzer:ct

Conversation

@anntzer
Copy link
Copy Markdown
Contributor

@anntzer anntzer commented Sep 25, 2023

We can just dispatch add_label based on the value of the internal _use_clabeltext flag. This change is also preparing for a possible future change where we always have use_clabeltext=True (which is needed for contour labels to be properly rotated after changes of axes aspect ratio, and should have no drawback except for a tiny(?) performance cost).

PR summary

PR checklist

Comment on lines +3 to +5
... is deprecated. `.ContourLabeler.add_label` now sets
`.Text.set_transform_rotates_text` based on the value of *use_clabeltext*
passed to the `.ContourLabeler` constructor.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The latter part of this note belongs in a behaviour change note, I think.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure.

We can just dispatch add_label based on the value of the internal
_use_clabeltext flag.  This change is also preparing for a possible
future change where we always have use_clabeltext=True (which is needed
for contour labels to be properly rotated after changes of axes aspect
ratio, and should have no drawback except for a tiny(?) performance
cost).
@QuLogic QuLogic added this to the v3.9.0 milestone Oct 3, 2023
@QuLogic QuLogic merged commit f263edf into matplotlib:main Oct 3, 2023
@anntzer anntzer deleted the ct branch October 3, 2023 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants