Skip to content

Add ticks.minus_in_math config for math minus in arcsec labels#387

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/ticks-minus-in-math
Jul 14, 2026
Merged

Add ticks.minus_in_math config for math minus in arcsec labels#387
Jammy2211 merged 1 commit into
mainfrom
feature/ticks-minus-in-math

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

What

Adds a ticks.minus_in_math config flag (default false) to visualize/general.yaml. When true, _arcsec_labels renders 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.″05 instead of -0.″05.

Why

_arcsec_labels is the single tick-label chokepoint for all 2D plot panels (image-plane via array.py/grid.py, source-plane via inversion.py). It emitted an ASCII hyphen for negatives, inconsistent with matplotlib's own axes.unicode_minus behaviour 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

  • Additive and gated behind a default-off flag → zero behaviour change for existing users.
  • Works with both label formats (suffix 3.8" and symbol-over-decimal 3.″8).

Tests

test_autoarray/plot/test_utils.py::test_arcsec_labels_minus_in_math asserts 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

`_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>
@Jammy2211 Jammy2211 merged commit d066eae into main Jul 14, 2026
4 checks passed
@Jammy2211 Jammy2211 deleted the feature/ticks-minus-in-math branch July 14, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant