![gnuplot - 无法为图表排版 LaTeX 标题](https://linux22.com/image/456248/gnuplot%20-%20%E6%97%A0%E6%B3%95%E4%B8%BA%E5%9B%BE%E8%A1%A8%E6%8E%92%E7%89%88%20LaTeX%20%E6%A0%87%E9%A2%98.png)
我有这个 gnuplot 脚本:
f(x) = 5 * log(x) / log(2) - 5 - sqrt(5 + x)
F = '$5 \log_2(x) - 5 - \sqrt{5 + x}$'
set yrange [0:30]
set xrange [0:3000]
set terminal epslatex size 10.0cm,10.0cm color colortext
set output 'RunTimeComparisonTreeIndexed.tex'
set style line 1 linecolor rgb "#ff6666" linetype 1 linewidth 5
plot f(x) title F with lines ls 1
replot
exit
所以我想要实现的是在灰色图例框中排版 LaTeX 表达式,而不是在等宽字体中排版重复的表达式。
答案1
这适用于以下脚本(仅单独添加set terminal
):
生成_tex.gp
f(x) = 5 * log(x) / log(2) - 5 - sqrt(5 + x)
F = '$5 \log_2(x) - 5 - \sqrt{5 + x}$'
set yrange [0:30]
set xrange [0:3000]
set terminal epslatex standalone size 10.0cm,10.0cm color colortext
set output 'RunTimeComparisonTreeIndexed.tex'
set style line 1 linecolor rgb "#ff6666" linetype 1 linewidth 5
plot f(x) title F with lines ls 1
跑步:
gnuplot generate_tex.gp
pdflatex RunTimeComparisonTreeIndexed.tex
结果: