scripts: plotmpl.py: Added --w/hpad/w/hspace for low-level pad control

These just expose the low-level w/hpad and w/hspace controls available
in matplotlib's constrained_layout.

---

I think something funky might be going on with matplotlib's
constrained_layout. I've noticed a relatively annoying amount of padding
as the number of plots in the grid grow quite large. Though as is usual
with plotmpl.py, this may just be my own fault with the amount of hacks
being applied.

--w/hpad and --w/hspace provide a temporary workaround by overriding the
low-level padding controls in matplotlib's constrained_layout (--w/hpad
should probably be preferred, --w/hspace seems to be a legacy option).

Though, while a temporary solution, these are probably a good idea to
keep around for easy tweaking of plot padding.
This commit is contained in:
Christopher Haster
2026-02-15 04:05:28 -06:00
parent 36c3a1467b
commit a290c98880
2 changed files with 37 additions and 4 deletions
+4 -2
View File
@@ -2135,14 +2135,16 @@ if __name__ == "__main__":
nargs='?',
type=lambda x: int(x, 0),
const=0,
help="Width in columns. <=0 uses the terminal width. Defaults "
help="Width in columns. <=0 uses the terminal width. In subplots "
"this instead expresses a ratio of the current grid. Defaults "
"to min(terminal, 80).")
parser.add_argument(
'-H', '--height',
nargs='?',
type=lambda x: int(x, 0),
const=..., # handles shell prompt spacing, which is a bit subtle
help="Height in rows. <=0 uses the terminal height. Defaults "
help="Height in rows. <=0 uses the terminal height. In subplots "
"this instead expresses a ratio of the current grid. Defaults "
"to 17.")
parser.add_argument(
'-X', '--xlim',