How to change the legend window size and font size inside the legend window?

I need to design a shape with at least 12 graphics in the gnuplot epslatex terminal. The problem is that the number of graphs becomes larger, the size of the legend window becomes larger and it overlaps with the graphs. How can I control the font size inside the legend window, as well as the size and location of the legend window? My gnuplot script is as follows. After compiling the script file, the tex file that is created cannot be compiled. Please inform.

Gnuplot script:

reset
set terminal epslatex color colortext size 11cm,7.5cm standalone
set output "obspI=12.tex"

set style data lines
set multiplot
set log


set key samplen 1 left bottom 
set key at 0.02,0.005
set key box lt 1 lc -2 lw 3

set xlabel "$t/N$"
set ylabel '$P_\ell(t)$'

set format y  '$10^{%L}$'
set format x  '$10^{%L}$'

set xr [0.01:1000]
set yr [0.002:1.5] 

plot 'sp_e21_N20I1.dat' u 1:2 w l title '\footnotesize $\ell=1,N=20,E=21$' lc 7 lw 2, \
     'sp_e19_N20I1.dat' u 1:2 w l title '\footnotesize $\ell=1,N=20,E=19$' lc 1 lw 2, \
     'sp_n_N20I1.dat' u 1:2 w l title '\footnotesize $\ell=1,N=20$', \
     'sp_e21_N20I10.dat' u 1:2 w l title '\footnotesize $\ell=10,N=20,E=21$'  lw 2, \
     'sp_e19_N20I10.dat' u 1:2 w l title '\footnotesize $\ell=10,N=20,E=19$'  lw 2, \
     'sp_n_N20I10.dat'   u 1:2 w l title '\footnotesize $\ell=10,N=20$'  lw 2, \
     'sp_e21_N40I1.dat' u 1:2 w l title '\footnotesize $\ell=1,N=40,E=21$'  lw 2, \
     'sp_e19_N40I1.dat' u 1:2 w l title '\footnotesize $\ell=1,N=40,E=19$'  lw 2, \
     'sp_n_N40I1.dat' u 1:2 w l title '\footnotesize $\ell=1,N=40$', \
     'sp_e21_N40I20.dat' u 1:2 w l title '\footnotesize $\ell=20,N=40,E=21$'  lw 2, \
     'sp_e19_N40I20.dat' u 1:2 w l title '\footnotesize $\ell=20,N=40,E=19$'  lw 2, \
     'sp_n_N40I20.dat'   u 1:2 w l title '\footnotesize $\ell=20,N=40$'  lw 2

unset multiplot
set output
+4
source share
1 answer

The size of the main text (with or without a box) can be controlled with

set key font ",FONT_SIZE"

(where FONT_SIZE may be, for example, 10.5).

. . ; , , ,

set key outside

"" "", :

set key width -12

, .

+4

All Articles