Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Clarify that explicit ticklabels are used without further formatting. #26951

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Sep 28, 2023

This was not made explicit in the docs (it is in essence due to the use of FixedFormatter, but that's a rather involved detail for end users). Also minor rewordings.

Closes #26947.

PR summary

PR checklist

@story645
Copy link
Member

but that's a rather involved detail for end users

I think "Labels cannot be further formatted using a Formatter object because they are formatted using FixedFormatter` is more clarifying than confusing?

@anntzer
Copy link
Contributor Author

anntzer commented Sep 28, 2023

This feels too focused on the specific question asked in #26947: if you are that user and seeing exactly that problem, sure, that sentence will help. But if you're just reading this docstring without having met exactly the problem reported in #26947, I do think that addition would just confuse things.

@story645
Copy link
Member

To me, the proposed version suggests that you don't need to use a formatter, not that you can't use a formatter.

@tacaswell tacaswell added this to the v3.9.0 milestone Sep 28, 2023
@tacaswell
Copy link
Member

Independent of if we agree that this closes #26947, this is an improvement to the docs.

@anntzer
Copy link
Contributor Author

anntzer commented Oct 4, 2023

@tacaswell Good to go?

@story645
Copy link
Member

story645 commented Oct 4, 2023

Independent of if we agree that this closes #26947

The person who opened #26947 said this wording probably wouldn't prevent them from making the same mistake, so yeah it doesn't close #26947 #26947 (comment)

@@ -1962,7 +1962,7 @@ def set_ticklabels(self, labels, *, minor=False, fontdict=None, **kwargs):
labels : sequence of str or of `.Text`\s
Texts for labeling each tick location in the sequence set by
`.Axis.set_ticks`; the number of labels must match the number of
locations.
locations. The labels are used as is, without further formatting.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe make it explicit that a Formatter is being used, and hence if you use another it will obviate this one?

Suggested change
locations. The labels are used as is, without further formatting.
locations. The labels are used as is, and passed to a `.FixedFormatter`.

Copy link
Member

Choose a reason for hiding this comment

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

I find "used as is" ambiguous b/c it's unclear to me what state "as is" is referring to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I went for a variant of @jklymak's wording.

Copy link
Member

Choose a reason for hiding this comment

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

Looks like only one entry was changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

indeed, fixed.

This was not made explicit in the docs (it is in essence due to the use
of FixedFormatter, but that's a rather involved detail for end users).
Also minor rewordings.
@timhoffm timhoffm merged commit 9cd50a3 into matplotlib:main Oct 5, 2023
@anntzer anntzer deleted the tlf branch October 5, 2023 22:48
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.

[Bug]: using "set_major_formatter" after "set_ticks" reset ticks arragement
6 participants