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.
This commit is contained in:
+1
-1
@@ -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):
|
||||
|
||||
+1
-1
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user