问题描述
我正在寻找一种在地块上添加小图标的方法,例如OK或KO符号,标志,箭头等.
I am looking for a way to add small icons on the plot, like OK or KO symbols, flags, arrows and such.
到目前为止,我已经看到了一个示例,您可以在其中添加背景图像,但实际上并没有允许我在绘图上设置点的方法,就像我可以对标签进行操作并在其中应用图标一样.
So far I've seen an example where you can add a background image, but nothing that actually allow me to set a point on the plot, like I could do with a label, and apply there an icon.
有办法吗?
推荐答案
叫我沉迷,但像往常一样,可以使用epslatex
终端完成,使用set label
语句嵌入图像,就像在常规乳胶中一样.如果您的图像是so-icon.png
,则在gnuplot中执行:
Call me obsessive but as usual this can be done with the epslatex
terminal, embedding the image using a set label
statement as you would do in regular latex. If your image is so-icon.png
, then within gnuplot do:
set terminal epslatex standalone header "\\usepackage{graphicx}"
set output "plot.tex"
set label at screen 0.5,0.5 '\includegraphics{so-icon.png}'
plot sin(x)
现在运行pdflatex
pdflatex plot.tex
您的输出将被命名为plot.pdf
,如下所示:
Your output will be named plot.pdf
and look like this:
将标签的位置(help set label
了解更多信息)更改为所需的位置.您还可以使用\includegraphics{}
的格式设置选项,例如\includegraphics[width=2cm]{}
用于图像的2厘米宽版本(对不起,我没有英寸!).
Change the positioning of the label (help set label
for more info) to wherever you want. You can also use the formatting options of \includegraphics{}
, for example \includegraphics[width=2cm]{}
for a 2cm wide version of your image (sorry, I don't do inches!).
请注意,如果要嵌入PNG,JPEG,GIF,PDF等,则需要pdflatex
命令,您不能将常规latex
用于这些内容.
Note that if you want to embed PNG, JPEG, GIF, PDF and so on, the pdflatex
command is required, you cannot use regular latex
for those.
这篇关于Gnuplot:有没有办法在情节上添加小gif图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!