How to add custom label to Gnuplot graph legend

gnuplot

In a graph I'm making with gnuplot I draw some grey lines (set arrow command), which represent the physical boundaries of my experiment (i.e., walls)

I would like to know how I can add this information on the legend of the graph, so it says "Walls" and have a grey line next to it.

I thought about creating a new series that contained this information, but I was wondering if it's possible to explicitly add it.

Best Answer

You can't add information directly to the legend. You can, however, either draw the legend explicitly, or plot a line which will not appear within the range of the plot, e.g.

plot [][0:1] 2 lc rgb 'gray' t 'Walls'

Or, if your x and y limits are already set:

...
[set x and y limits here]
...
plot 1e20 lc rgb 'gray' t 'Walls'
Related Topic