Skip to content

Conversation

krystophny
Copy link
Collaborator

Fix: unify axis tick label formatting of log and symlog plots.

  • Applies power-of-ten mathtext formatting 10^{n} (with braces) to both log and symlog scales.
  • Ensures multi-digit exponents render as true superscripts across backends (PDF/PNG/ASCII-mathtext pipeline).
  • Negative powers retain sign prefix (-10^{n}) consistent with existing log behavior.

Changes

  • src/ui/fortplot_axes.f90
    • format_tick_label: treat symlog power-of-ten ticks like log.
    • format_power_of_ten: switch to 10^{n} with braces.
  • src/utilities/ticks/fortplot_tick_formatting.f90
    • format_log_tick_value: consistent 10^{n} with braces for fallback powers.

Evidence

  • Ran: make build && make example ARGS="scale_examples".
  • Artifacts:
    • output/example/fortran/scale_examples/log_scale.txt shows 10^{4}, 10^{3}.
    • output/example/fortran/scale_examples/symlog_scale.txt shows 10^{5}, 10^{4}.
  • Ran make verify-artifacts (local checks OK; CI will run full suite).

Notes

  • CI-fast had an environment timeout tool missing in one optional step; core build/examples succeeded.
  • The ASCII grid for symlog has a cosmetic 010^{2} due to tight label spacing; numeric label text is correct (10^{2}).

Closes: #

… 10^{n} superscripts; apply to symlog powers of ten (branch: fix/symlog-tick-superscript)
…st label per row at left edge; also centralize power-of-ten label builder and reuse in axes
…erscripts appear; fix(ascii): avoid bottom-row y-label overlap and offset inside frame
…parse and render elements); fix(ascii): simplify 10^{n} to 10^n and prevent bottom-row overlap
…h table; keep friendly formatting for common powers (1, 10, 100, …) to improve alignment and spacing
@krystophny krystophny merged commit 7cd1bb1 into main Sep 8, 2025
2 checks passed
@krystophny krystophny deleted the fix/symlog-tick-superscript branch September 8, 2025 20:27
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