Skip to content

Commit 5aa2988

Browse files
committed
Use relative colorbar size to minimize baseline churn (#687)
Keep the colorbar width relative to the panel (size as a percentage) rather than absolute inches; only the pad is absolute (decoration clearance + stacking gap). This matches the previous inset width closely, so single right-side colorbars are visually unchanged and only the genuinely-affected colorbars (left/top/bottom, stacked, all-sides) get new baselines.
1 parent f2a62ae commit 5aa2988

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/spatialdata_plot/pl/basic.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1571,7 +1571,7 @@ def _draw_colorbar(
15711571
pad_in = CBAR_STACK_PAD_INCHES if n_on_side else clearance.get(location, 0.0) + max(pad, 0.0) * ref_in
15721572
cax = divider.append_axes(
15731573
location,
1574-
size=Fixed(max(fraction, 0.0) * ref_in),
1574+
size=f"{max(fraction, 0.0) * 100}%",
15751575
pad=Fixed(pad_in),
15761576
axes_class=Axes,
15771577
)

0 commit comments

Comments
 (0)