||
1. 要知道gunuplot如何输出为epslatex
gnuplot中的的关键代码
set term epslatex standalone color set terminal epslatex font "ptm,," 10 #默认字体使用Time New Roman字体10pt |
这样会生成*.tex文件
在cmd中使用 pdflatex.exe -synctex=0 -silent test.tex
可以转成pdf文件
2. 要知道latex中实现文字加背景的工具
colorbox比较简单
高级一点的是:tcolorbox
可以实现许多酷炫的功能
例如( 参考上面的链接以及texlive2020的 tcolorbox.pdf 帮助文档):
3.将tcolorbox引入到gnuplot中
先要设置一下tcolorbox,下面代码中黄底红字可以修改
set term epslatex header \ "\ \n\ % Loads tcolorbox \n\ \\usepackage{tcolorbox} \n\ \\AtBeginDocument{\\tcbset{colback=red,size=minimal}} \n\ \n" |
上面用tcbset设置参数:
colback=red红色背景
size=minimal留白最少
比如在gnuplot的label中使用:
set label 1 "\\tcbox{$t_1$}" at 1.5,0.5 front |
注意上面黄底红字有连个反斜杠\\
实现效果如下:
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-5-2 03:10
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社