1
我有一个gnuplot
脚本,并将其绘制图是这样的:如何将图例添加到gnuplot中的圆圈?
这里是我的脚本:
set term pdf size 11,4.7 font "Arial,24"
set output "plot/application.pdf"
set object circle at 9,20 size 0.35 lw 4 fc rgb "red"
plot 'plot/application.csv' using 1:xtic((int($0)%4)==0?sprintf("%d", $0*10):"") title columnheader(1) pt 1 lw 1, \
'' using 2 title columnheader(2) pt 2 lw 1 ps .1 lc rgb "#4169E1", \
'' using 3 title columnheader(3) pt 3 lw 1 ps .1 lc rgb "#DAA520", \
'' using 4 title columnheader(4) pt 4 lw 1 ps .1 lc 5, \
'' using 5 title columnheader(5) pt 4 lw 1 ps .1 lc 9, \
'' using 6 title columnheader(6) pt 4 lw 1 ps .1 lc 7, \
'' using 7 title columnheader(7) pt 5 lw 1 ps .1 lc 8, \
'使用7标题的columnHeader(8)第5部分LW 1' ps .1 lc 9
所以基本上我想添加一个传说对应于添加的圆圈,使它看起来像这样:
我试图从set object
调整到类似plot xxx with circles
,但语法总是不正确。
任何人都可以给我一些帮助,生成一个正确的图例?万分感谢!
我在这里上传我的数据文件。
process1, process2, process3, process4, process5, process6, process7, process8
100, 100, 100, 100, 100, 100, 100, 100
79.69 , 81.42 , 78.13 , 87.694 , 78.231 , 80.231 , 78.231 , 73.231
62.53 , 73.97 , 61.58 , 73.539 , 71.401 , 71.401 , 78.401 , 65.401
49.98 , 62.85 , 50.50 , 54.987 , 59.922 , 53.922 , 64.922 , 56.922
35.89 , 43.60 , 40.41 , 45.897 , 40.010 , 44.010 , 51.010 , 43.010
29.44 , 33.73 , 30.85 , 37.448 , 30.488 , 35.488 , 43.488 , 31.488
20.05 , 25.53 , 33.86 , 30.059 , 27.098 , 23.098 , 34.098 , 27.098
19.88 , 20.67 , 26.25 , 25.68 , 20.45 , 20.45 , 27.45 , 18.45
19.01 , 20.04 , 24.25 , 20.01 , 19.358 , 19.358 , 25.358 , 15.358
21.88 , 18.61 , 22.06 , 23.88 , 20.054 , 20.054 , 20.054 , 15.054
21.18 , 18.33 , 23.67 , 22.91 , 19.022 , 19.022 , 19.022 , 12.022
17.01 , 20.04 , 24.25 , 18.01 , 23.358 , 14.358 , 13.358 , 10.358
19.88 , 14.61 , 20.06 , 16.88 , 21.054 , 15.054 , 10.054 , 5.054
16.18 , 12.33 , 23.67 , 15.91 , 16.022 , 12.022 , 9.022 , 9.022
和我的完整的脚本在这里:
set term pdf size 11,4.7 font "Arial,24"
set output "plot/application.pdf"
set datafile separator ","
set offset 0, 0, 0, 0
set multiplot layout 1,1
set size ratio 0.5
set xtics norangelimit
set ytics nomirror
set termoption dashed
set yrange [0:110]
set style data linespoints
set key vertical maxrows 5
set key top right
set key vertical maxrows 5
set object circle at 9,20 size 0.35 lw 4 fc rgb "red"
plot 'plot/application.csv' using 1:xtic((int($0)%4)==0?sprintf("%d", $0*10):"") title columnheader(1) pt 1 lw 1, \
'' using 2 title columnheader(2) pt 2 lw 1 ps .1 lc rgb "#4169E1", \
'' using 3 title columnheader(3) pt 3 lw 1 ps .1 lc rgb "#DAA520", \
'' using 4 title columnheader(4) pt 4 lw 1 ps .1 lc 5, \
'' using 5 title columnheader(5) pt 4 lw 1 ps .1 lc 9, \
'' using 6 title columnheader(6) pt 4 lw 1 ps .1 lc 7, \
'' using 7 title columnheader(7) pt 5 lw 1 ps .1 lc 8, \
'' using 8 title columnheader(8) pt 5 lw 1 ps .1 lc 9, \
Hello Christoph,谢谢你的帮助。我尝试了第一个,但它没有显示任何东西... – computereasy
你是从脚本运行它还是复制粘贴?后者无法正常使用内联数据。在这里,圆形绘制正确,但没有您的数据文件,我无法测试整个命令。 – Christoph
我从脚本运行它。我在问题中上传了我的完整脚本和数据文件,如果你有时间,可以请看一看吗?万分感谢!! – computereasy