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