fix: compute radar_plot axis padding from the original range - #793
Open
tonycoder-hub wants to merge 1 commit into
Open
fix: compute radar_plot axis padding from the original range#793tonycoder-hub wants to merge 1 commit into
tonycoder-hub wants to merge 1 commit into
Conversation
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>
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.
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