how to set label and line the same color in gnuplot

假如想象 提交于 2019-11-29 10:14:45

Try this instead:

set label "AC" at 0, 70 textcolor linetype 1

or

set label "AC" at 0, 70 textcolor linespec 1

Read the manual in gnuplot> help label to learn more.

The answer by @holygeek works fine. Coming from python, I find that it is often nice to be a little more explicit.

set style line 1 lw 1 lc rgb "red"
set label "AC" at 0, 70 tc rgb "red"

Note that the set of color names recognized by your gnuplot is system dependent (see show colornames for a complete list). To achieve complete system independence, you can use the #RRGGBB version. e.g. red is '#ff0000, green is #00ff00 and blue is #0000ff. of course, you can make up all sorts of interesting colors (again, see show colornames for a list of pre-defined colors and their equivalent #.....)

for more info, also see help colorspec

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!