2015-03-31 50 views
4

我对gnuplot边距有点困惑。首先我不知道这些东西指向什么单位。它们是指向画布坐标还是它们是画布坐标的一小部分?它们在gnuplot模式和多槽模式下表现相同吗?gnuplot边距如何在多槽模式下工作?

当我在多槽模式下绘制一些数据时出现问题。我正在绘制屏幕(wtx终端)。让我们只说我糟糕的东西 - 我从画布上得到情节,或者很小的不可读的情节。

没有边距,第一个绘图与画布顶部齐平,所以很自然地我想把它压低一点。

有人可以解释gnuplot边缘如何工作,如果他们在多槽模式下表现相同。

回答

5

是的,在“正常”绘图模式和多槽模式下,边距表现非常相似。基本上,边距可以有三种不同的“模式”:

  1. 自动,这是默认值。
  2. 将每个页边距设置为特定尺寸,如set lmargin 2。单位是字符宽度(或字符高度tmarginbmargin)。
  3. 设置边框相对于整个画布的特定位置,如set lmargin at screen 0.1,它将左边的绘图边框设置为总画布宽度的10%。

multiplot模式的唯一不同的是,对于在1和2的边缘的基准通过由layout选项确定的位点给出:

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 

enter image description here

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 

enter image description here

如果你想设置每个b的绝对位置为了这变得更加麻烦,因为你必须设置4利润率为每个曲线(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版提供了一个非常灵活的方式来产生相等矩形,看我的回答Removing blank gap in gnuplot multiplot

+0

这是一个非常全面的答案,我非常感激。无论您是在屏幕上使用set lmargin还是set lmargin,这些单位都会有所不同,这是造成混淆的原因,现在已经澄清 – Xofo 2015-03-31 22:20:47