From c80a647ea9623d75a2dad9b35efdff18f43e0a0e Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Sat, 7 Feb 2026 12:40:09 +1000 Subject: [PATCH] Limit pixel snapping to main axes --- ultraplot/figure.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ultraplot/figure.py b/ultraplot/figure.py index 798378909..aebb9e777 100644 --- a/ultraplot/figure.py +++ b/ultraplot/figure.py @@ -903,7 +903,9 @@ def _snap_axes_to_pixel_grid(self, renderer) -> None: minw = invw minh = invh - for ax in self._iter_axes(hidden=False, children=False, panels=True): + # Only snap main subplot axes. Guide/panel axes host legends/colorbars + # that use their own fractional placement and can be over-constrained. + for ax in self._iter_axes(hidden=False, children=False, panels=False): bbox = ax.get_position(original=False) old = np.array([bbox.x0, bbox.y0, bbox.x1, bbox.y1], dtype=float) new = np.array(