Skip to content

Label normalized wind rose ticks as percentages - #365

Open
maoji-y wants to merge 1 commit into
python-windrose:mainfrom
maoji-y:fix/normalized-radial-labels
Open

maoji-y wants to merge 1 commit into
python-windrose:mainfrom
maoji-y:fix/normalized-radial-labels

Conversation

@maoji-y

@maoji-y maoji-y commented Nov 22, 2026

Copy link
Copy Markdown

Fixes #294.

The radial tick labels now include % on normalized bar, box, contour, and filled contour wind roses. The labels use the existing tick positions and numeric precision. Changing the label angle preserves the units, and clearing the axes resets them. The percentage sign is escaped when labels use TeX.

The example from the issue works with plot_windrose(df, kind="bar", normed=True) without setting a Matplotlib formatter. Thanks to needham-michael for the example.

Validation

  • On Windows with Python 3.13 and Matplotlib 3.10.6, pytest -Werror tests passed all 44 tests. Five new assertions failed for missing percent signs on the unmodified code. The regression cases cover the four histogram plot types, counts, label angle changes, clearing the axes, and TeX escaping.
  • Regenerated the five normalized image baselines. With --mpl, 43 tests passed. The existing test_subplots image mismatch reproduces on the unmodified 1bfe215 with the same RMS difference.
  • Ruff lint and format checks for windrose/ and tests/ and git diff --check passed.

Codex assisted with implementation and validation.

This branch has not been deployed

No deployments
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.

Automatic Percentage Formatting of Normed Axes

1 participant