Clarify dollar_ticks example and FormatStrFormatter docs.#27601
Clarify dollar_ticks example and FormatStrFormatter docs.#27601story645 merged 1 commit intomatplotlib:mainfrom
Conversation
lib/matplotlib/ticker.py
Outdated
| "${x}$"). | ||
|
|
||
| It is typically unnecessary to explicitly construct `.StrMethodFormatter` | ||
| objects, as `~.Axis.set_major_formatter` also directly accepts the format |
There was a problem hiding this comment.
| objects, as `~.Axis.set_major_formatter` also directly accepts the format | |
| objects, as `~.Axis.set_major_formatter` directly accepts the format |
lib/matplotlib/ticker.py
Outdated
| 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}$"). |
There was a problem hiding this comment.
| 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?
There was a problem hiding this comment.
Edited.
FormatStrFormatter doesn't interact with the unicode_minus rcParam, although it probably could...
dollar_ticks only uses FormatStrFormatter implicitly.
| 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}$"). |
There was a problem hiding this comment.
why does this need to be here twice?
There was a problem hiding this comment.
Because it applies both to FormatStrFormatter and to StrMethodFormatter. (Actually this may change with #27602...)
There was a problem hiding this comment.
I hate github code folding sometimes. :/
| 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}$"). |
There was a problem hiding this comment.
I hate github code folding sometimes. :/
dollar_ticks only uses FormatStrFormatter implicitly.
Closes #25967.
PR summary
PR checklist