2015-10-18 53 views
0

我有一個矩陣來繪製,我使用下面幾行:繪製R上的問題(使用熱圖)

library(lattice) 
levelplot(cont.freq) 

我想擺脫在情節的黑色的東西呢?我想使用矩陣的rownames和colname作爲x & y標籤。但是我不知道如何以一種很好的方式來表達它們。

順便說,矩陣是1284x1284 ..

enter image description here

+1

你能告訴cont.freq和你的整個代碼的樣本?例如: – torm

+0

a = rep(0:1,5) b = rep(0,10) c = rep(1,10) cont.freq = matrix(cbind(a,b,c) = 10,ncol = 10) cont.freq – wthimdh

回答

0

以下工作:

x_at <- pretty(seq_len(nrow(cont.freq))) 
y_at <- pretty(seq_len(ncol(cont.freq))) 
levelplot(cont.freq, rm.na = TRUE, scales=list(y=list(at=y_at),x=list(at=x_at)), xlab="Residue ID", ylab="Residue ID", main="Contact Frequency")