2012-02-24 102 views
7

我是gnuplot的新手,在繪製堆積直方圖時,發現圖例隱藏在數據後面。gnuplot:圖例隱藏在數據後面

有沒有一種方法可以將圖例置於數據之上?非常感謝你的幫助。 編輯:我目前正在使用設置密鑰外底部放置傳說外,但這不是我想要的最佳解決方案。

回答

3

最新版本允許使傳奇的白色背景:

set key opaque 

這只是增加了一個白色背景,傳說中那麼它出現在所有圖的頂部。在this Post找到答案。

3

如果你寧願對數據,而不是情節箱共外鍵上方的按鍵,這裏是一個解決方法(使用罪(10 * X)爲例):

set multiplot 
unset key 
plot sin(10*x) # this will plot with tics and a border, but no key 
set key box 
unset tics 
unset border 
bignumber=10 # make this number larger than the y range so the line will not be seen 
plot [][0:1] bignumber title 'sin(10*x)' # this will just plot the key with the title 
unset multiplot 

使用這種方法,首先繪製數據/函數,然後在剛剛有一個鍵的頂部創建一個繪圖。您必須確保正確設置第二個標題的標題。

+1

感謝您的解決方案,但不是更多的解決方法? Gnuplot以某種方式必須允許在沒有多槽技巧的情況下在所有數據之上繪製圖例,對吧?我認爲這不是一個很少的情況或特殊的功能,...仍然在尋找更好的東西... – 2013-08-26 11:57:08

+0

現在,我已經學會了更老,更聰明,我已經學會了'set key opaque'命令,它在繪製所有數據後繪製關鍵字! – andyras 2013-08-26 19:17:07