How to set a label and align the same color in gnuplot

Very simple stuff. I want a function, like function f, to be built with a specific color. I also need a piece of the label with the inscription "function f color", which is also displayed in this color.

I am trying to do this so far:

set style line 1 lw 3 lc 1 set label "AC" at 0, 70 textcolor 1 

but apparently "lc" and "textcolor" follow different specifications, and he complains:

 "trolo4.pl", line 8: colorspec option not recognized 

any help would be great!

+7
source share
2 answers

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 at gnuplot> help label to find out more.

+6
source

The answer from @holygeek works great. Based on python, I find it 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 version #RRGGBB . for example, red is '#ff0000 , green is #00ff00 , and blue is #0000ff . of course, you can create all kinds of interesting colors (again, see show colornames for a list of predefined colors and their equivalent #..... )

see also help colorspec for more information

+6
source

All Articles