I have plotted this table in gnuplot. as you can see the key should be seperated in two parts. The first 4 keys should remain in their place but the rest 4 keys should move down so that they won't cross the data.
How can I split the key this way?
One plot only supports a single key, so it can not be split. Also, all data is plotted by one single plot command, so you can not plot the first half of the data, change settings of the key and that plot the other half.
There are other ways to place the key, e.g. outside the plot area.
However, I have two workarounds:
First, you can add dummy plots:
plot \
sin(x),
"+" u 1:(NaN) title " " w dots linecolor rgb "white",
"+" u 1:(NaN) title " " w dots linecolor rgb "white",
cos(x) title "cosinus",
tan(x) title "tangens"
Due to the 1:(NaN)
, no data is plottet. The single dot in the legend is white, and the title is a white space. So, it looks like empty lines in the key:
The other solution is to create two plots using multiplot:
set xrange[...]
set yrange[...]
set multiplot
plot sin(x)
set key bottom right
plot cos(x) linetype 2
unset multiplot
note that you have to set the ranges explicitly here. Also, axes, tics and labels are drawn twice, which may look odd on some output formats. In this case, you can unset all of them before the second plot, so everything is drawn only once.
While this way is a bit more complicated, you have much more control over your key:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With