如何在边距顶部放置标签?

时间:2018-06-04 12:41:35

标签: gnuplot

我正在使用带有epslatex终端的gnuplot。我想知道怎么把 标签位于边距之上,因此标签下方的部分边距是不可见的。在附图中,标签下方的边缘部分 仍然可见。

the unsatisfied plot

1 个答案:

答案 0 :(得分:1)

原则上,您应该能够告诉gnuplot使用set label ... front boxed将文本标签放入框中,并使用类似set style textbox opaque noborder fillcolor rgb "white"的内容指定框应该是不透明的和白色的。但是,并非所有终端都支持此功能,而epslatex似乎是其中之一无效的终端之一。

但是,在epslatex中,您只需使用latex命令在标签文本周围创建一个白色背景框:

set term epslatex standalone
set outp "test.tex"
set label "\\colorbox{white}{This is a label}" at 6.,0.5 front
plot sin(x)
set output

给出

enter image description here