From 6998a100888747a9641099aa372237e36273e81b Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Sun, 15 Feb 2026 00:40:15 -0600 Subject: [PATCH] scripts: plot[mpl].py: Prioritize subplot subplots before plot subplots A small tweak, but this resolves some confusing interactions between subplot subplots and regular subplots. Consider: ./scripts/plot.py test.csv -xx \ --subplot=" \ -ya \ --subplot-below=\" \ -yab\"" \ --subplot-right=" \ -yb \ --subplot-below=\" \ -ybb\"" You would normally expect -yab and -ybb to end up side-by-side. But because regular subplots were parsed fully before subplot subplots, -yab confusingly ended up beneath the sum of -ya + (-yb + -ybb). The small tweak of prioritizing subplot subplots fixes this, and results in the expected 2x2 grid of plots. --- scripts/plot.py | 2 +- scripts/plotmpl.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/plot.py b/scripts/plot.py index 25bb6add..742035f1 100755 --- a/scripts/plot.py +++ b/scripts/plot.py @@ -1332,7 +1332,7 @@ def main_(ring, csv_paths, *, # subplot can also contribute to subplots, resolve this here or things # become a mess... - subplots += subplot.pop('subplots', []) + subplots = subplot.pop('subplots', []) + subplots # allow any subplots to contribute to by/x/y def subplots_get(k, *, subplots=[], **args): diff --git a/scripts/plotmpl.py b/scripts/plotmpl.py index abc6c03c..b838a762 100755 --- a/scripts/plotmpl.py +++ b/scripts/plotmpl.py @@ -980,7 +980,7 @@ def main(csv_paths, output, *, # subplot can also contribute to subplots, resolve this here or things # become a mess... - subplots += subplot.pop('subplots', []) + subplots = subplot.pop('subplots', []) + subplots # allow any subplots to contribute to by/x/y/defines def subplots_get(k, *, subplots=[], **args):