Fix colorbar gallery placement and domains [mpl compatibility] - #246
Fix colorbar gallery placement and domains [mpl compatibility]#246sselvakumaran wants to merge 12 commits into
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
|
in the red plot, the the legend is smaller, but it probably should not be forced to show more ticks to accomodate. the red one should only have 3, bc in this version the tick spacing is too little bc theres so many ticks / numbers. |
|
Addressed the short red colorbar tick density in Correction to the earlier evidence: that image omitted #245, so it rendered the fallback blue palette and did not represent the combined gallery state. This replacement reruns the exact Matplotlib 3.11
Matplotlib 3.11 / combined before / combined fixedThe renders are full and uncropped. XY is shown normalized from its native 2x export only so all three rows have the same displayed dimensions. Verification of the corrected combined render:
The underlying #246 code at |
|
Fresh CI confirms the earlier red was transient: Test (Rust + Python + JS) passed on |
|
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 |
Document the shared colorbar spec object's location/anchor/shrink and minor-tick options, their defaults and coordinate conventions, and the exclusion of masked samples from an inferred colorbar domain.

What changed
colorbar(location=..., anchor=..., shrink=...)Why
The official Matplotlib 3.11
colorbar_basics.pyexample uses a shrunken/anchored left colorbar and minor ticks. xy previously rejected those options; it also let masked sentinel values distort the second panel's domain.Official reference: https://matplotlib.org/stable/gallery/color/colorbar_basics.html
The final panel was rendered with this PR plus #245, because the official script also requires the independently missing
Reds_rcolormap. With both branches combined, the exact gallery script completes and the colorbar orientation, placement, domain, extension, and minor ticks are technically correct.Scope
This does not add
colorbar(cax=...);subplots_adjust.pyremains a separate blocker. It also does not touch autoscale margins or the tick-spacing work owned by #240.Validation
544 passed, 65 skippedacross the full pyplot suite