gnuplot:canvas外部溢出的标签是';画

gnuplot:canvas外部溢出的标签是';画,gnuplot,Gnuplot,我将标签放在直方图条的顶部(偏移10),如下所示: plot "hist.txt" using 1:2 with boxes ls 1, "hist.txt" using 1:($2+10):(sprintf("%.1f%%",$2)) with labels 当条形图值为87%时,它将绘制标签 当条形图的值为92%时,可能因为没有足够的空间,所以不会绘制标签。我如何告诉它绘制标签,并且我不介意它是否会溢出预期的画布大小?假设您将y轴

我将标签放在直方图条的顶部(偏移10),如下所示:

plot "hist.txt" using 1:2 with boxes ls 1, "hist.txt" using 1:($2+10):(sprintf("%.1f%%",$2)) with labels
当条形图值为87%时,它将绘制标签


当条形图的值为92%时,可能因为没有足够的空间,所以不会绘制标签。我如何告诉它绘制标签,并且我不介意它是否会溢出预期的画布大小?

假设您将y轴的范围限制为0~100,将不会绘制92+10(=102)的y值,因为它超过了yrange的最大值

如果使用标签偏移量为0的
,前10个
作为打印样式规范,而不是使用
移动标签在
中的位置,则效果良好

set key noautotitle

set tmargin screen 0.85
set xrange [0:11]
set yrange [0:100]

plot "hist.txt" using 1:2 with boxes ls 1, \
     "hist.txt" using 1:2:(sprintf("%.1f%%",$2)) with labels offset 0,first 10
示例“hist.txt”是

1 30
2 60
3 87
4 92
5 50
6 20
7 10
8 30
9 50
10 40