34

How do I adjust the size of the legend in gnuplot (4.6.0)? By this I mean the size of the lines and not just the font size. When I switched from the pdf to pdfcairo terminal the size suddenly jumped and caused the key to overlap the points of interest. (I needed cairo to enable unicode.)

An answer I have just invented is (e.g.):

set key font ",8"
set key spacing 0.5

Is there a better way?

1
  • It looks like we were reading the docs at the same time -- and is there a better way? not really, unless you consider set key spacing 0.5 font ",8" to be significantly better ...
    – mgilson
    May 31, 2012 at 13:12

1 Answer 1

70

To adjust the length of the samples:

set key samplen X

(default is 4)

To adjust the vertical spacing of the samples:

set key spacing X

(default is 1.25)

and (for completeness), to adjust the fontsize:

set key font "<face>,<size>"

(default depends on the terminal)

And of course, all these can be combined into one line:

set key samplen 2 spacing .5 font ",8"

Note that you can also change the position of the key using set key at <position> or any one of the pre-defined positions (which I'll just defer to help key at this point)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.