2011-10-04 36 views
3

我使用R鍵繪製的CSV文件(10(列)條件和1000(樂華))[R熱圖,Y軸的標籤出來是非常接近

以下是一個數據的熱圖我使用的代碼..

nba <- read.csv("1317754115.csv", sep=",") 
nba_matrix <- data.matrix(nba) 
cexRow = 0.2 + 1/log10(1000), 
cexCol = 0.2 + 1/log10(10), 
nba_heatmap <- heatmap(nba_matrix, Rowv=cexRow, Colv=cexCol, 
    col = heat.colors(256), scale="column", margins=c(5,10)) 

enter image description here Heat Map Image

現在在右手邊行非常接近,所以我不能閱讀標籤名稱,

可以有一個人請告訴我如何能顯示在Y軸上的所有標籤

感謝

+0

不要忘記添加你正在從你的情節變得 – Stedy

+0

對不起,我錯過了形象,我已經添加了鏈接,熱圖 – KAPILP

回答

2

不能與基本heatmap功能改變長寬比。要獲得此功能,請參閱gplotsheatmap.2,或aspectHeatmapClassDiscovery包。這裏有一個例子:

require(gplots) 

nrow = 100 
ncol = 10 

set.seed(12345) 
row.names = replicate(nrow, paste(letters[sample(10)], collapse='')) 
col.names = replicate(ncol, paste(letters[sample(10)], collapse='')) 

values = matrix(runif(nrow*ncol), nrow=nrow, dimnames=list(row.names, col.names)) 

dev.new(width=5, height=10) 
heatmap(values) 
dev.new(width=5, height=10) 
heatmap.2(values) 

enter image description here enter image description here

+0

感謝圖像你約翰,我的熱圖現在看起來好多了 – KAPILP