gnuplot边距如何在多图模式下工作? [英] How do gnuplot margins work in multiplot mode?

查看:280
本文介绍了gnuplot边距如何在多图模式下工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对gnuplot的边距有些困惑.首先,我不知道这些东西指向什么单元.它们是指向画布坐标还是指向画布坐标的一小部分.它们在gnuplot模式和multiplot模式下的行为是否相同?

I am a bit confused about gnuplot margins. First of all I have no idea what units these things are pointing to. Are they pointing to the canvas coordinates OR are they a fraction of the canvas coordinates. Do they behave the same in gnuplot mode and multiplot mode?

在多图模式下绘制某些数据时,出现了我的问题.我正在绘图到屏幕(wtx终端).只是说我很糟糕-我从画布上拿了一些图,或者是很小的不可读的图.

My problem arises when plotting some data in multiplot mode. I am plotting to the screen (wtx terminal). Let's just say I am bungling things badly - I get plots off the canvas, or very small unreadable plots.

第一个情节没有边距,与画布的顶部齐平,因此我自然希望将其向下推一点.

Without margins the first plot is flush against the top of the canvas, so naturally I want to push it down a bit.

有人可以解释gnuplot边距如何工作以及它们在多图模式下的行为是否相同.

Can someone explain how gnuplot margins work and if they behave the same in multiplot mode.

推荐答案

是的,边距在正常"绘图模式和多重绘图模式下的行为非常相似.基本上,边距可以具有三种不同的模式":

Yes, the margins behave very similar in "normal" plotting mode and in multiplot mode. Basically, the margins can have three different "modes":

  1. 自动,这是默认设置.
  2. 将每个边距设置为特定大小,例如set lmargin 2.
  3. 单位是字符宽度(或tmarginbmargin的字符高度).
  4. 设置相对于整个画布的边框的特定位置,例如set lmargin at screen 0.1,它将左侧绘图边框设置为画布总宽度的10%.
  1. Automatic, which is the default.
  2. Setting each margin to a specific size, like set lmargin 2. The unit is character widths (or character heights for tmargin and bmargin).
  3. Setting a specific position of a border relative to the whole canvas, like set lmargin at screen 0.1, which sets the left plot border at 10% of the total canvas width.

multiplot模式的唯一区别在于,layout选项确定的位置给出了1和2中的边距的引用:

The only difference of the multiplot mode is, that the reference for the margins in 1. and 2. is given by the sites determined by the layout option:

set multiplot layout 2,2

这会将整个画布细分为四个大小相等的矩形.现在,使用

This subdivides the whole canvas in four rectangles of equal size. Now, using

set lmargin 1
set rmargin 1
set tmargin 1
set bmargin 1

相对于较小的矩形,在每个子图的每一侧留出一个字符宽度或高度的边距:

leaves a margin of one character width or height on each side of each subplot with respect to the smaller rectangles:

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选项没有任何作用):

If you want to set absolute positions of each border, this becomes more cumbersome, because you have to set four margins for each plot (the layout options doesn't have any effect in this case):

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多图样中删除空白的答案

Gnuplot version 5 offers a quite flexible way to produce equal rectangles, see my answer to Removing blank gap in gnuplot multiplot

这篇关于gnuplot边距如何在多图模式下工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆