Gnuplot position key element custom position

Hi I have a problem on how gnuplot position the key elements. gnuplot key

As you can see EdgeCast and EdCast-RTMP label are overlapped while between Twitter-Generic and Yandex-1 there is a lot of space.

Is it possible to redistribute the space between the elements?

I tried several solutions like:

set key font ",26" width -4 at graph 0.45, graph 1.2 center maxrows 3
set key samplen 1.8

But all of them moved all keys and not only the one I am Interested in.

Unfortunately I think it is not possible, however as best result I wish to have the key as follow:

key1 key2 key3

key4 key5 key6

....   key7 key8

In this way I can have much more space for the long label.

Is it possible?

Upvotes: 1

Views: 2997

Answers (1)

ewcz
ewcz

Reputation: 13087

a slightly dirty way how to fine-tune the structure of a multi-component legend is to invoke multiplot in the following fashion:

set multiplot

#fix the "plot window", i.e., the effective area of the plot itself
#so that its position is the same in all the subsequent plot(s)
set tmargin at screen 0.8
set bmargin at screen 0.1
set lmargin at screen 0.1
set rmargin at screen 0.8

# set the desired tics, axes, etc.

#specify an absolute position for the first part of the legend
set key ... at screen 0.1,0.9

# plot first, say, 3 lines

#unset all tics, border, etc. so that it is not generated again
#in the  subsequent plot command(s) below
unset xtics;unset ytics
unset xlabel;unset ylabel
unset border

#specify position of the second part of the legend
set key ... at screen 0.5,0.9

#plot other 3 lines

Here, the screen units range from 0. to 1. and express the relative position w.r.t. the entire "plot".

Upvotes: 3

Related Questions