I am trying to move the box of this key (legend) in gnuplot.
It looks like this right now but I want the key to be centered in the box.
If I make the box smaller the key makes a part of the box to disappear as well as can be seen in this picture
.
The code used the produce the first plot below is:
set xlabel 'Time'
set ylabel 'Rad/s'
set title 'Top 1'
set key box width 2 height 3 opaque
plot 'top1lspin.txt' using 1:5 with lines title '{/Symbol ~y{1.1.}}'
The same affect can be seen with other plot commands, e.g.:
set xlabel 'Time'
set ylabel 'Rad/s'
set title 'Top 1'
set key box width 2 height 3 opaque
plot sin(x) title '{/Symbol ~y{1.1.}}'
Best Answer
Without using some LaTeX-based terminal which would offer much more control than just the limited set of enhanced postscript commands, I am afraid that there are just "ugly" solutions to the problem.
One might:
border
onset key
, generate the legend as is and then draw a "fake" border usingset rectangle
. However, the placement of the box here is rather annoying...\psi
. This will provide more-or-less fine alignment with respect to the line sample in the legend. Alignment with respect to the box is then achieved by appending a phantom space.In total:
this then produces: