2011-03-30 21 views
11

我正在嘗試創建一個具有多個堆積直方圖的圖,如示例8 here。但對於我的數據,每個組都有相同的四個類別。Gnuplot:多個堆積直方圖,每個組使用相同的密鑰

enter image description here

如何改變顏色和鍵,使顏色變爲紅色,綠色,藍色,粉紅色,每疊列?那麼關鍵只有一個我正在繪製的4件東西的副本?

這裏是我使用繪製行:

plot newhistogram "1", 'addresses.dat' using 2:xtic(1) t 2, '' u 3 t 3, \ 
'' u 4 t 4, '' u 5 t 5, newhistogram "2", '' u 6 t 6, '' u 7 t 7, '' u 8 t 8,\ 
'' u 9 t 9 

我的數據是相同的格式爲我聯繫到上面的例子:

Address PAL_Code BASH App Kernel PAL_Code BASH App Kernel 
FFT 1 1 2 2 1 1 3 4 
RADIX 1 2 3 4 1 2 4 5 
LU 1 3 4 5 1 3 5 6 

太感謝你了,如果你可以幫助!

回答

10

在newhistogram後面使用lt說明符以指定gnuplot應該使用的第一個顏色。我寫了一個小腳本,可能你想要做什麼;)

set style data histogram 
set style histogram rowstack gap 1 
set style fill solid border -1 
set boxwidth 0.9 
set key autotitle columnheader 
set key outside below center horizontal 
plot newhistogram "1" lt 1, 'addresses.dat' u 2:xtic(1), '' u 3, '' u 4, '' u 5,\ 
newhistogram "2" lt 1, 'addresses.dat' u 6:xtic(1) notitle, '' u 7 notitle, \ 
'' u 8 notitle, '' u 9 notitle 

希望幫助

Cherio
Woltan

+0

完美,非常感謝! – Philip 2011-03-30 19:04:43

+0

你知道我怎樣才能完全分配新顏色? – user2373198 2016-10-18 13:11:38

相關問題