2016-06-20 28 views
3

我正在使用兩個盒子的多槽作爲傳說的兩組數據。但是,我遇到了以下問題:使用網格時,第二個盒子始終位於網格後面。 使用下面的代碼(從SE另一個問題借來的修改):Gnuplot:在網格後面的多槽中的第二個傳說

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

我想第二個框是不透明的網格,就像第一個。如果您禁用xticsytics,命令#unset grid不會執行任何操作,因爲沒有網格。

回答

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

相關問題