2014-02-20 35 views
1

我有400個離散變量序列,長度各不相同,其中零是簡單的佔位符。例如:隨着時間的推移可視化DNA /狀態序列

X=[ 
    5 3 5 5 4 1 4 4 2 
    5 4 4 3 3 4 5 2 4 
    5 2 4 4 2 3 3 3 0 
    2 3 3 3 0 0 0 0 0 
    4 5 3 3 2 3 3 3 3 
    3 2 4 2 3 3 5 0 0 
    2 4 4 5 4 5 5 0 0 
    4 2 5 5 0 0 0 0 0 
    ] 

如何在單個圖形或動畫中隨時間變化這些不斷變化的序列? 樓梯圖看起來不錯,但我不能把400個序列放在一張圖上,它會混亂。 enter image description here

在每個時間段最可能的狀態的柱狀圖的柱狀圖是這樣的,但它不是很直觀:

[f x]=hist(X6,0:1:5); 
bar3c(f) 

enter image description here

有什麼想法?

+1

哪些信息應該在最終圖形是可見的? – Daniel

+0

我想顯示序列的時間變化,也許是平均的。如果可能的話,它也是黑白或灰度。有人建議這個http://www.gapminder.org/videos/ Gapminder類型的情節是有趣的... – HCAI

回答

3

怎麼樣簡單的圖片:

X = X+1; %Because otherwise your zeros and ones come out as the same colour for some weird reason I don't understand 

I = uint8(X./max(X(:))*255); 
image(I); 
colormap(autumn(256)); %// or grey(256) for b&w 
colorbar; 

否則可能

bar3(X) 
相關問題