2016-06-20 3 views
3

두 개의 데이터 집합에 대해 범례로 두 개의 상자가있는 곱셈을 사용하고 있습니다. 그러나 다음과 같은 문제가 발생했습니다. 격자를 사용할 때 두 번째 상자는 항상 격자 뒤에 있습니다.Gnuplot : 격자 뒤의 multiplot에서 두 번째 범례

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" 

당신이 얻을 출력은 다음과 같습니다 : 이 enter image description here

내가처럼 그리드에 불투명하기 위해 두 번째 상자를하고자하는 다음 코드 (SE에서 또 다른 질문에서 빌린 수정)를 사용하여 첫번째. #unset grid 명령은 xticsytics을 비활성화하면 그리드가 없기 때문에 아무 것도하지 않습니다. 두 번째 키에서

답변

3

사용 opaque : 그것 뿐이다

... 
set key at graph 0.5, 0.5 
set key opaque 
.... 
+0

. 나는 그런 옵션이없는 잘못된 매뉴얼 (4.2 버전)에서 검색하고 있다는 것을 몰랐다. 그러나 4.6 매뉴얼에 있습니다 : http://gnuplot.info/docs_4.6/gnuplot.pdf – Nister

관련 문제