O'Reilly logo

gnuplot Cookbook by Lee Phillips

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Putting a box around the legend

This recipe is a simple modification of the previous one, but gets its own section because the legend in the box is such a popular style (for better or worse).

Putting a box around the legend

How to do it…

Replace the highlighted set key command in the previous recipe with the following two commands:

set key spacing 3 font "Helvetica, 14"
set key box lt -1 lw 2

How it works…

The new command is in the second line. set key box tells gnuplot to draw a box around the legend; this is followed by two specifications for the type of line from which the box will be drawn. In the previous command, we have used abbreviations: lt stands for linetype, and a linetype ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required