Fix pie labels and boxed text [mpl compatibility]#243
Conversation
Merging this PR will degrade performance by 23.82%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | test_select_lasso_message_1m |
93.3 ms | 122.4 ms | -23.82% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing agent/gallery-compat-pie-text-vector (2946fc6) with main (960e132)
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. ↩
|
pie chart:
|
|
I worked through each visual point in the comparison and pushed The comparison uses the same What changed:
The axes title and suptitle did not need a centering change. Pixel measurement against the Matplotlib 3.11 reference puts the XY centers at 324.75/320.5 px versus 324.5/320.0 px, respectively. The apparent offset was under 0.5 px, not a 2x-DPI error. Verification:
|
|
I also checked the refreshed CodSpeed red on
So there is no causal performance fix to make in #243. The actionable rendering checks, including Matplotlib 3.11 compatibility and the full Rust/Python/JS test job, are green. |

Summary
Fix the Matplotlib 3.11 pie-label and text-command gallery paths:
{absval:d}formatting workspie_label(..., rotate=True)alignment and radial label geometryAxes.text(style="italic", bbox=...)across browser, SVG, and native PNG renderingsubplots_adjust(...)This is separate from #240 and does not change autoscale margins, ticks, or bar extents.
Gallery references
Pie labels — before / Matplotlib / after
Before, the gallery aborts as soon as it requests rotated labels. After, all eight gallery figures complete. SVG keeps the radial text rotations; native PNG currently renders arbitrary-angle glyphs upright, which is a small renderer-specific text variation.
Text commands — before / Matplotlib / after
Before, the first italic boxed label aborts the example. After, the full annotated figure renders, including the box, font styling, and figure suptitle.
Verification
547 passed, 65 skippedintests/pyplotpie_label.py: all 8 PNG captures completetext_commands.py: PNG capture completesgit diff --checkpass