eva*_*ncy 8 label gnuplot colors linestyle
很简单的东西.我想要一个函数,比如函数f,用特定的颜色绘制.我还想要一个标有"功能f颜色"的标签,它也以该颜色显示.
到目前为止我正在尝试这个:
set style line 1 lw 3 lc 1
set label "AC" at 0, 70 textcolor 1
Run Code Online (Sandbox Code Playgroud)
但显然"lc"和"textcolor"遵循不同的规格,它抱怨:
"trolo4.pl", line 8: colorspec option not recognized
Run Code Online (Sandbox Code Playgroud)
任何帮助都会很棒!
试试这个:
set label "AC" at 0, 70 textcolor linetype 1
Run Code Online (Sandbox Code Playgroud)
要么
set label "AC" at 0, 70 textcolor linespec 1
Run Code Online (Sandbox Code Playgroud)
阅读手册gnuplot> help label以了解更多信息.
@holygeek的答案很好.来自python,我发现通常更好一点.
set style line 1 lw 1 lc rgb "red"
set label "AC" at 0, 70 tc rgb "red"
Run Code Online (Sandbox Code Playgroud)
请注意,gnuplot识别的颜色名称集取决于系统(show colornames有关完整列表,请参阅参考资料).要实现完全的系统独立性,您可以使用该#RRGGBB版本.例如,红色是'#ff0000,绿色是#00ff00,蓝色是#0000ff.当然,你可以组成各种有趣的颜色(再次,请参阅show colornames预定义颜色及其等价物的列表#.....)
有关更多信息,请参阅 help colorspec