Add ticks.minus_in_math config for math minus in arcsec labels#387
Merged
Conversation
`_arcsec_labels` emitted an ASCII hyphen (U+002D) for negative tick values. Add a `ticks.minus_in_math` config flag (default false) that, when true, renders negatives with the Unicode/math minus (U+2212, matplotlib's own minus glyph), e.g. −0.″05 instead of -0.″05. Applies to both the suffix and symbol-over-decimal label formats and is the single tick-label chokepoint used by all 2D plot panels. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a
ticks.minus_in_mathconfig flag (defaultfalse) tovisualize/general.yaml. When true,_arcsec_labelsrenders negative tick values with the Unicode/math minus sign (U+2212, matplotlib's own minus glyph) instead of an ASCII hyphen (U+002D), e.g.−0.″05instead of-0.″05.Why
_arcsec_labelsis the single tick-label chokepoint for all 2D plot panels (image-plane viaarray.py/grid.py, source-plane viainversion.py). It emitted an ASCII hyphen for negatives, inconsistent with matplotlib's ownaxes.unicode_minusbehaviour and with astronomy/LaTeX typesetting. This makes the proper math minus available natively (as a config) rather than requiring per-figure custom label helpers.Scope / safety
3.8"and symbol-over-decimal3.″8).Tests
test_autoarray/plot/test_utils.py::test_arcsec_labels_minus_in_mathasserts U+2212 appears (and the ASCII hyphen does not) when the flag is on, for both label formats; existing tests unchanged and green.🤖 Generated with Claude Code