Gnuplot线条和图例的颜色

3
我正在尝试使用Gnuplot创建线图。每条线都用不同的颜色表示。我想要的是键与线的颜色相同。这是我现在拥有的,当前版本。是否可以将文本“Line 2”设置为橙色,“Line 3”设置为红色等?
这是我在gp文件中编写的内容:
set xlabel'x-axis'; \
set xrange[0:25];\
set ylabel 'y-axis';\
set yrange [2:9];\
set key left top;
p   'test.dat' using 1:2 w linespoints lw 5 lc rgb '#aadc32' pt 17 title 'Line 1' ,\    
'test.dat' using 1:9 w linespoints lw 5 lc 'orange' lt 1 title 'Line 2',\
'test.dat' using 1:6 w linespoints lw 5 lc 'red' lt 8 title 'Line 3',\
'test.dat' using 1:7 w linespoints lw 5 lc 'violet' pt 6 title 'Line 4',\'test.dat' using 1:8 w linespoints lw 5 lc rgb '#b5367a' pt 19 title 'Line 5',\
'test.dat' using 1:3 w linespoints lw 5 lc 'cyan' pt 9 title'Line 6',\
'test.dat' using 1:4 w linespoints lw 5 lc 'blue' lt 9 title 'Line 7',\
'test.dat' using 1:10 w linespoints lw 5 lc rgb '#1c1044' lt 5 title 'Line 8',\

Thank you so much.

1个回答

4
很抱歉,情节标题(现在,gp5.2pl0)不认识“textcolor”说明符。
plot x lw 3 lc rgb "blue" title "x" tc rgb "blue" # doesn't work

你只能打印一个空的(“”)图表标题,并在其上覆盖带颜色的标签。
set label 1 at 8,1 "bluetitle" tc rgb "blue"

需要对标签的位置进行一些调整。
你可以在https://sourceforge.net/p/gnuplot/feature-requests/上提出功能请求。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接