【发布时间】:2016-06-20 18:45:53
【问题描述】:
我正在使用带有两个框的多图,用于两组数据作为图例。但是,我遇到了以下问题:使用网格时,第二个框总是在网格后面。 使用以下代码(从 SE 中的另一个问题借用并修改):
set term pngcairo
set output "legends.png"
set multiplot
# make a box around the legend
set key box
# fix the margins, this is important to ensure alignment of the plots.
set lmargin at screen 0.15
set rmargin at screen 0.98
set tmargin at screen 0.90
set bmargin at screen 0.15
set xrange[0:2*pi]
set yrange[-1:1]
set grid
# main plot command
plot sin(x) title "sinus"
# turn everything off
unset xlabel #label off
unset ylabel
set border 0 #border off
unset xtics #tics off
unset ytics
#unset grid #grid off
set key at graph 0.5, 0.5
plot cos(x) ls 2 lw 2 title "cosinus"
我希望第二个框对网格不透明,就像第一个框一样。命令#unset grid 不会执行任何操作,因为如果禁用xtics 和ytics,则没有网格。
【问题讨论】: