Search code examples
gnuplot

Setting a unique legend in a multiplot


I would like to have a unique legend preferably at the bottom of a multiplot. I have tried with set key at screen 0,5, screen 0.1 however it is not ideal as you can see. It is very close to the X labels and values. How can I push it a bit further down the graph?

enter image description here

What are my options? My multiplot is created with

set multiplot layout 2,2 rowsfirst offset 0, 0.001
set key at screen 0.58, screen 0.06

Any other ideas?


Solution

  • An alternative approach would be perhaps to specify the outer margins of the entire multiplot as well as the spacing between individual plots. Like this, one could reserve enough space in the (global) bottom margin for the legend:

    set multiplot layout 2,2 rowsfirst \
        margins char 8,char 2,char 8,char 2 \
        spacing char 8,char 4
    
    set key at screen 0.5, char 6
    
    plot x w l t 'x', x*x w l t 'x*x'
    plot x w l t ''
    plot x w l t ''
    plot x w l t ''
    

    This example would produce: enter image description here