0
votes

I'm am plotting multiple variables in gnuplot. I would like to centre the key under the plot, and centred on the plot area.

My current settings are:

set key outside
set key bottom center horizontal

This centres the key across the entire width of the plot. I would like to centre the key across the extent of the x axis; ie align it with the xlabel.

Is this possible in an automated fashion, or is tweaking involved?

Edit: This is all my mistake. I had asked gnuplot to plot a file that wasn't there, so its key was empty, but the space for it was still there, and that threw off the "alignment"; it was aligned with three entries, but not for the visible two.

1
It's not completely clear to me what you got and what you want to achieve. You are talking about "under the plot" but "align with the y-label"...or do you mean x-label? An illustration would help very much. - theozh
@theozh I meant xlabel. I'll work up a figure. - masher

1 Answers

0
votes

Depending on which arrangment and alignment you are looking for... also check help key for more options.

reset session

set multiplot layout 2,1 
set xlabel "This is the xlabel"

set key outside bottom center vertical
plot sin(x), cos(x), sin(-x), cos(-x)

set key outside bottom center horizontal
replot

unset multiplot

enter image description here