防止tic标签在gnuplot中调整图形大小

时间:2014-12-03 17:57:50

标签: resize gnuplot axes autosize

我试图制作一个我不知道范围的一般情节。有时会有更多的零或一个" - "在tic标记上,这会导致图形区域收缩。我希望tic标签只是向左延伸,保留图形大小。这有助于对齐,这是这些图的关键部分。

有没有人知道如何做到这一点?我的搜索还没有透露任何内容。

1 个答案:

答案 0 :(得分:2)

您可以使用set lmargin设置固定的左边距。用例如set lmargin 10您将左边距固定为10个字符宽度:

set multiplot layout 2,1
set lmargin 10    
set xrange [0:10]
plot x

set xrange[0:100000]
plot x
unset multiplot

enter image description here

当然,您仍然必须为左边距大小找到合适的设置。

另一点,标签位置也取决于标签长度。

set multiplot layout 2,1
set lmargin 10
set ylabel 'ylabel'

set xrange [0:10]
plot x

set xrange[0:100000]
plot x
unset multiplot

enter image description here

因此您需要使用offset参数更改ylabel位置。为了使它更通用,您可以使用通常的set label命令将ylabel设置为独立于边距设置进行修复:

set multiplot layout 2,1
set lmargin 10
set label 1 'manual label' at screen 0.03,graph 0.5 center rotate by 90

set xrange [0:10]
plot x

set xrange[0:100000]
plot x
unset multiplot

enter image description here

相关问题