gpt4 book ai didi

gnuplot - 如何更改图例框的大小和图例框内的字体大小?

转载 作者:行者123 更新时间:2023-12-02 13:20:26 27 4
gpt4 key购买 nike

我需要在 gnuplot epslatex 终端中构建一个至少包含 12 个图的图形。问题是当图的数量变大时,图例框的大小就会变大并且与图重叠。如何控制图例框内的字体大小以及图例框的大小和位置?我的 gnuplot 脚本如下。脚本文件编译后,生成的tex文件无法编译,请指教。

Gnuplot 脚本:

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

最佳答案

按键文本大小(带或不带框)可以通过控制

set key font ",FONT_SIZE"

(例如,其中 FONT_SIZE 可以是 10.5)。

有关放置 key 盒的信息,请参阅 here 。有很多选择;您可以使用例如

将 key 放置在主要人物之外
set key outside

key 盒的高度和宽度可以通过“height”和“width”控制,例如:

set key width -12

希望有所帮助。

关于gnuplot - 如何更改图例框的大小和图例框内的字体大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22121400/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com