how to set label and line the same color in gnuplot

Evan Pu picture Evan Pu · Jun 27, 2012 · Viewed 36.9k times · Source

Very simple stuff. I want a function, say function f, to be plotted with a particular color. I also want a piece of label saying "function f color" which is also displayed in that color.

I am trying this so far:

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

but apparently the "lc" and "textcolor" follows different specs, and it complains:

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

any help would be great!

Answer

holygeek picture holygeek · Jun 27, 2012

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.