From 36c3a1467b7a21af26bdf84b577d517a3b9f5b5a Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Sun, 15 Feb 2026 01:02:10 -0600 Subject: [PATCH] scripts: plot.py: Fixed subplots with differing widths This was completely broken due to the renderer ignoring s.xspan. As a result, subplots could end up rendered multiple times if they spanned neighboring subplots. Quick example: ./scripts/plot.py test.csv -xx \ --subplot="-ya" \ --subplot-right="-yb" \ --subplot-below="-yc" Fortunately the fix is easy, just make sure to increment x_ += s.xspan as we render subplots across the x-axis. Curiously the behavior was already correct for the y-axis, I guess because the y-axis is quite a bit more complicated with how it crosses multiple lines. --- scripts/plot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/plot.py b/scripts/plot.py index 742035f1..569073bb 100755 --- a/scripts/plot.py +++ b/scripts/plot.py @@ -1811,7 +1811,8 @@ def main_(ring, csv_paths, *, for line in ylabel_) if ylabel_ else '') - for x_ in range(grid.width): + x_ = 0 + while x_ < grid.width: # figure out the grid x/y position subrow = row y_ = len(heights)-1 @@ -1821,6 +1822,7 @@ def main_(ring, csv_paths, *, s = grid[x_, y_] subrow = row - sum(heights[s.y+s.yspan:]) + x_ += s.xspan # header if subrow < s.ymargin[-1]: