3

When I use "plot with labels" with various groups of points everything is ok, labels appear in different colors.

However I could not find a way to set the key (legend) properly I would like to have a sample of the text color used for each group of points. All a get is the title associated to each group.

set term x11 
set key outside 
set grid 
set xlabel "#occurences"
set ylabel "F-score"
set title "Experiment"
plot "-" lw 1 with labels font "\"Helvetica\"" tc lt 1 title "foo" , "-" lw 1 with labels font "\"Helvetica\"" tc lt 2 title "bar"  
96.0 0.24390244 11
5547.0 0.7443704 24
3974.0 0.83244646 114
241.0 0.16025642 174
6220.0 0.7571273 188
7810.0 0.8637012 206
e

98.0 0.0 4
96.0 0.11320755 11
5547.0 0.75145125 24
3974.0 0.8333118 114
6220.0 0.7646692 188
7810.0 0.87222874 206
e
3
  • Could you update your question including some sample data to fool around with? This would make answering your question a lot easier. Commented Jan 24, 2012 at 14:17
  • A few month later I' m back with this issue. Edited my question to provide complete example. I would like the word "foo" to appear in red and the word "bar" in green. Commented May 22, 2012 at 14:20
  • 2
    I just had an answer from another forum. It is necessary to do : set key textcolor variable Commented May 22, 2012 at 19:06

1 Answer 1

1

That is done with set key textcolor variable, as stated in the comments:

set key outside textcolor variable
set grid 
set xlabel "#occurences"
set ylabel "F-score"
set title "Experiment"
plot "-" lw 1 with labels font "\"Helvetica\"" tc lt 1 title "foo" , "-" lw 1 with labels font "\"Helvetica\"" tc lt 2 title "bar"  
96.0 0.24390244 11
5547.0 0.7443704 24
3974.0 0.83244646 114
241.0 0.16025642 174
6220.0 0.7571273 188
7810.0 0.8637012 206
e

98.0 0.0 4
96.0 0.11320755 11
5547.0 0.75145125 24
3974.0 0.8333118 114
6220.0 0.7646692 188
7810.0 0.87222874 206
e

Result with 4.6.5:

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.