Fix categorical pyplot gallery rendering [mpl compatibility] - #253
Fix categorical pyplot gallery rendering [mpl compatibility]#253sselvakumaran wants to merge 3 commits into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Merging this PR will degrade performance by 39.52%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | test_build_bar_categorical_pyplot |
4.3 ms | 7.2 ms | -39.52% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing agent/categorical-geometry-gallery-compat (40adc1e) with agent/fix-pyplot-autoscale-margins (3b3c2ab)
Footnotes
-
1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports. ↩
|
maybe a problem solved by another PR - labels should ideally go where there is no lines if possible; like the label here should go in the upper left or lower right of the graph. otherwise this specific fix works. |
Summary
bar(..., label=[...])legend semantics, including underscore filtering and each patch's resolved colorbarhwidthsRoot causes
Pyplot's pre-build autoscale scan discarded string coordinates, so categorical line and scatter plots fell back to a dataless
(0, 1)view and clipped every category after the second. Separately, a sequence passed as a bar label was stringified as one container label instead of being attached to the individual bar patches.Visual comparison
Columns are Matplotlib 3.11, the branch base, and this PR. The first row shows the per-bar legend fix; the second shows all six categorical trajectories restored.
Validation
PYTHONPATH=python /Users/srimans/dev/reviz/.venv/bin/python -m pytest -q tests/pyplot/test_categorical_gallery_regressions.py— 5 passedPYTHONPATH=python /Users/srimans/dev/reviz/.venv/bin/python -m pytest -q tests/pyplot— 558 passed, 65 skippedbar_colors.pyandcategorical_variables.py