0
votes

I have a plot which looks like this:

I would like to add a color legend, preferably outside the graph itself. So, for example, a legend with a red dot and, after it, a description of what each red point in the plot means. Similarly for blue.

i.e.

(red dot) 'description'

(blue dot) 'description'

Is there a way to do this in gnuplot?

1
Yes, remove the parts from your script where you hide the legend (remove unset key or plot ... notitle or plot title '' or their abbreviated forms. - Christoph

1 Answers

0
votes

first, set the key properly:

set key top right outside

Then add title of to the plot command like this:

plot 'data1.txt' title 'description 1', 'data2.txt' title 'description 2'