是的,边距在“正常”绘图模式和多重绘图模式下的行为非常相似。基本上,边距可以具有三种不同的“模式”:
- 自动,这是默认设置。
- 将每个边距设置为特定大小,例如
set lmargin 2
。单位是字符宽度(或字符高度tmargin
and bmargin
).
- 设置具体的position相对于整个画布的边框,例如
set lmargin at screen 0.1
,它将左图边框设置为画布总宽度的 10%。
唯一的区别是multiplot
模式是,1. 和 2. 中的边距参考由由layout
option:
set multiplot layout 2,2
这将整个画布细分为四个大小相等的矩形。现在,使用
set lmargin 1
set rmargin 1
set tmargin 1
set bmargin 1
相对于较小的矩形,在每个子图的每一侧留下一个字符宽度或高度的边距:
set multiplot layout 2,2
set lmargin 0
set rmargin 0
set tmargin 0
set bmargin 0
set format ''
plot x
plot x**2
plot x**3
plot x**4
unset multiplot
set multiplot layout 2,2
set lmargin 1
set rmargin 1
set tmargin 1
set bmargin 1
set format ''
plot x
plot x**2
plot x**3
plot x**4
unset multiplot
如果你想设置每个边框的绝对位置,这会变得更麻烦,因为你必须为每个图设置四个边距(layout
选项在这种情况下没有任何作用):
set multiplot
set lmargin at screen 0.1
set rmargin at screen 0.47
set tmargin at screen 0.97
set bmargin at screen 0.6
plot x
...
Gnuplot 版本 5 提供了一种非常灵活的方式来生成相等的矩形,请参阅我的回答删除 gnuplot multiplot 中的空白