Fix GridSpec and aspect gallery APIs [mpl compatibility]#242
Fix GridSpec and aspect gallery APIs [mpl compatibility]#242sselvakumaran wants to merge 6 commits into
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
|
after fix, grids that have another grid on its right has it's rightmost border cut off |
|
Addressed the clipping report in 88d8d26. I reproduced both exact Matplotlib 3.11 gallery examples on:
PR #240 did not repair the missing right spines/tick labels by itself. The layout-specific causes were:
The fix keeps the axes patch opaque but alpha-composites transparent outer panel chrome, preserves the original GridSpec geometry, reserves deterministic tick/title gutters for tight layout, and includes terminal ticks inside each panel canvas. The four columns below are Matplotlib 3.11, PR #242 before, PR #242 fixed, and the fixed PR #242 with PR #240 applied: The combined column confirms the division of responsibility: this PR restores complete panel bounds/layout; PR #240 additionally improves autoscale margins and tick selection/spacing. Validation:
|


Summary
Fix two Matplotlib 3.11 gallery failures in the pyplot compatibility layer:
adjustableargument used byAxes.set_aspect("equal", "box")Axes.get_gridspec(),get_subplotspec(), andAxes.remove()This is intentionally separate from #240 and does not change tick or default margin behavior.
Gallery references
Equal aspect — before / Matplotlib / after
Before, the example aborts at the fourth axes and leaves it elliptical. After, the positional API works and the fourth plot is a circle with the expected auto-adjusted limits.
GridSpec spanning — before / Matplotlib / after
Before, the example aborts with a 3×3 grid. After, the two lower-right cells are removed and replaced with the intended spanning axes and annotation.
Verification
539 passed, 65 skippedintests/pyplotgit diff --checkpass