我知道我们可以使用 unset key 省略 GNUplot 中的键。如果我想插入一个小图像来表示 XY 二维图上的键,该怎么做?在 MS-Excel 中,只需复制图像并将其粘贴到绘图上并调整其位置和大小即可。在 GNUPlot 中也可以做这样的事情吗?通过什么情节选项?我在我制作的多图中附加了我期望的样本 a(左上角的图)。我将小分子图像作为 png 文件。我还列出了下面的代码。请帮我。谢谢。
reset
set size 1,1
set multiplot
unset key
#CPD
set size 0.5,0.5
set origin 0,0.5
unset title
plot 'Practice1.dat' using 1:2 w points lw 3 lc rgb 'red'
plot 'Practice1.dat' using 1:6 smooth csplines lw 3 lc rgb 'red'
#Ethene
set size 0.5,0.5
set origin 0.5,0.5
set title 'Ethene'
plot 'Practice1.dat' using 1:3 w l lw 3 lc rgb 'blue'
#Benzene
set size 0.5,0.5
set origin 0,0
set title 'Benzene'
plot 'Practice1.dat' using 1:4 smooth csplines lw 3 lc rgb 'green'
#H2
set size 0.5,0.5
set origin 0.5,0
set title 'H2'
plot 'Practice1.dat' using 1:5 w l lw 3 lc rgb 'black'
最佳答案
图像本身就是一个情节。
plot "image.png" binary filetype=png center=(975,40) dx=200 w rgbimage, \
'Practice1.dat' using 1:2 w points lw 3 lc rgb 'red', \
'Practice1.dat' using 1:6 smooth csplines lw 3 lc rgb 'red'
请注意,您应该避免在不更改多图中原点/大小的情况下使用多个绘图命令,因为标签和边框是重叠的,这可能会根据终端(因为例如抗锯齿)而改变它们的外观,因此使用
,
以及在多行上拆分命令(使用 \
)另请注意
set multiplot
可以自己为您完成简单的 2x2 绘图的布局,set multiplot layout 2,2
关于GNUplot - 如何将图像作为关键?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38681991/