Skip to content

fix: compute radar_plot axis padding from the original range - #793

Open
tonycoder-hub wants to merge 1 commit into
huggingface:mainfrom
tonycoder-hub:cursor/fix-radar-plot-axis-ranges-bf74
Open

fix: compute radar_plot axis padding from the original range#793
tonycoder-hub wants to merge 1 commit into
huggingface:mainfrom
tonycoder-hub:cursor/fix-radar-plot-axis-ranges-bf74

Conversation

@tonycoder-hub

Copy link
Copy Markdown

Summary

`radar_plot` padded min then max in sequence, so the max used the already-padded min and got 11% instead of 10% (e.g. 0–10 became `-1.0, 11.1`). When every model shares one value, the span is zero and the axis collapses; `ComplexRadar._scale_data` then flattens every model onto one radius (or produces NaNs for a single model).

Compute padding once from the original min/max, and use a non-zero fallback for constant variables.

Does not overlap with open #479 (label zip), #650 (docstring), or #781 (mutable default).

Test plan

  • `MPLBACKEND=Agg pytest tests/test_viz.py -q` → 4 passed
  • New tests fail on current main (`11.1 != 11.0`; two model shapes compare equal) and pass after

The upper padding was derived from the range after the lower bound had
already been shifted, so the top of each axis was padded by 11% of the
data range instead of 10%. A metric with the same value for every model
also produced a zero-width range, which made matplotlib warn about
singular limits and collapsed every other metric onto a single radius
(or produced NaN coordinates when all metrics were constant).

Co-authored-by: Tony Coder <407243179@qq.com>
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.

2 participants