8000 Clarify dollar_ticks example and FormatStrFormatter docs. by anntzer · Pull Request #27601 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Clarify dollar_ticks example and FormatStrFormatter docs. #27601

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
Jan 5, 2024

Conversation

anntzer
Copy link
Contributor
@anntzer anntzer commented Jan 5, 2024

dollar_ticks only uses FormatStrFormatter implicitly.

Closes #25967.

PR summary

PR checklist

"${x}$").

It is typically unnecessary to explicitly construct `.StrMethodFormatter`
objects, as `~.Axis.set_major_formatter` also directly accepts the format
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
objects, as `~.Axis.set_major_formatter` also directly accepts the format
objects, as `~.Axis.set_major_formatter` directly accepts the format

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

Comment on lines 363 to 365
Negative numeric values will use a dash, not a Unicode minus; use mathtext
to get a Unicode minus by wrapping the format specifier with $ (e.g.
"${x}$").
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Negative numeric values will use a dash, not a Unicode minus; use mathtext
to get a Unicode minus by wrapping the format specifier with $ (e.g.
"${x}$").
Negative numeric values (e.g. -1) will use a dash, not a Unicode minus; use mathtext
to get a Unicode minus by wrapping the format specifier with $ (e.g.
"${x}$").

The negative numeric values alliteration threw me for the half sec & I think this is a minor enough add save the sleep deprived.

Also how does this interact w/ the Unicode minus RcParams?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Edited.
FormatStrFormatter doesn't interact with the unicode_minus rcParam, although it probably could...

dollar_ticks only uses FormatStrFormatter implicitly.
Comment on lines +363 to +365
Negative numeric values (e.g., -1) will use a dash, not a Unicode minus;
use mathtext to get a Unicode minus by wrapping the format specifier with $
(e.g. "${x}$").
Copy link
Member

Choose a reason for hiding this comment

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

why does this need to be here twice?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because it applies both to FormatStrFormatter and to StrMethodFormatter. (Actually this may change with #27602...)

Copy link
Member

Choose a reason for hiding this comment

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

I hate github code folding sometimes. :/

Comment on lines +363 to +365
Negative numeric values (e.g., -1) will use a dash, not a Unicode minus;
use mathtext to get a Unicode minus by wrapping the format specifier with $
(e.g. "${x}$").
Copy link
Member

Choose a reason for hiding this comment

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

I hate github code folding sometimes. :/

@story645 story645 modified the milestones: v3.8.3, v3.9.0 Jan 5, 2024
@story645 story645 merged commit d3892d5 into matplotlib:main Jan 5, 2024
@anntzer anntzer deleted the dt branch January 5, 2024 18:44
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.

[Doc]: dollar_ticks example refers to unused formatter classes
2 participants
0