From e26678c884e147db0f54bb7ff0b629a4e60ae449 Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Fri, 6 Feb 2026 10:21:24 +1000 Subject: [PATCH] Fix ridgeline spacing for histogram mode --- ultraplot/axes/plot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ultraplot/axes/plot.py b/ultraplot/axes/plot.py index 74bfde749..1eefe9ce9 100644 --- a/ultraplot/axes/plot.py +++ b/ultraplot/axes/plot.py @@ -6525,7 +6525,7 @@ def _apply_ridgeline( else: # Categorical (evenly-spaced) positioning mode max_height = max(y.max() for x, y in ridges) - spacing = max_height * (1 + overlap) + spacing = max(0.0, 1 - overlap) artists = [] # Base zorder for ridgelines - use a high value to ensure they're on top @@ -6544,7 +6544,7 @@ def _apply_ridgeline( y_plot = y_scaled + offset else: # Categorical mode: normalize and space evenly - y_normalized = y / max_height + y_normalized = y / max_height if max_height > 0 else y offset = i * spacing y_plot = y_normalized + offset