GNUplot - 如何将图像作为关键?

标签 gnuplot

我知道我们可以使用 unset key 省略 GNUplot 中的键。如果我想插入一个小图像来表示 XY 二维图上的键,该怎么做?在 MS-Excel 中,只需复制图像并将其粘贴到绘图上并调整其位置和大小即可。在 GNUPlot 中也可以做这样的事情吗?通过什么情节选项?我在我制作的多图中附加了我期望的样本 a(左上角的图)。我将小分子图像作为 png 文件。我还列出了下面的代码。请帮我。谢谢。

enter image description here

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/

相关文章:

c - 如何在 C 程序中使用 gnuplot 绘制图表

使用多图时的 Gnuplot y 尺度

gnuplot - 使用不同颜色在 gnuplot 中绘制文件数据

conditional - gnuplot 引用 line2 的符号更改 line1 的颜色

linux - gnuplot:X 轴上未显示 xtics

Gnuplot:如何设置 pm3d map 透明?

gnuplot - 忽略远离平均 gnuplot 的点

linux - 为什么我的命令对 gnuplot 不起作用?

GNUplot - 绘图数据文件(简单的 X 和 Y 列) - 在图形上设置合适的颜色和比例

gnuplot - 如何在 GnuPlot 中使绘图变大