Skip to content

Commit c80a647

Browse files
committed
Limit pixel snapping to main axes
1 parent e92fe33 commit c80a647

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ultraplot/figure.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,9 @@ def _snap_axes_to_pixel_grid(self, renderer) -> None:
903903
minw = invw
904904
minh = invh
905905

906-
for ax in self._iter_axes(hidden=False, children=False, panels=True):
906+
# Only snap main subplot axes. Guide/panel axes host legends/colorbars
907+
# that use their own fractional placement and can be over-constrained.
908+
for ax in self._iter_axes(hidden=False, children=False, panels=False):
907909
bbox = ax.get_position(original=False)
908910
old = np.array([bbox.x0, bbox.y0, bbox.x1, bbox.y1], dtype=float)
909911
new = np.array(

0 commit comments

Comments
 (0)