2
내 다음 코드 : ColSideColors
가 너무 높은 것을 heatmap.2에서 ColSideColors의 높이를 단축하는 방법()
참고 :
library(gplots);
library(RColorBrewer);
dat <- read.table("http://pastebin.com/raw.php?i=wM7WxEvY",sep="\t",na.strings="NA",header=TRUE)
dat <- dat[complete.cases(dat),]
dat.log <- log2(dat);
# Clustering and distance function
hclustfunc <- function(x) hclust(x, method="ward")
distfunc <- function(x) dist(x,method="maximum")
# Here we cluster based on the Celltype (Column)
d <- distfunc(t(dat.log))
fit <- hclustfunc(d)
clusters <- cutree(fit, h=20)
nofclust.height <- length(unique(as.vector(clusters)));
# Colors setting
hmcols <- rev(redblue(256));
selcol <- colorRampPalette(brewer.pal(9,"Set1"))
clustcol.height = selcol(nofclust.height);
pdf(file="temp.pdf",width=30,height=40);
heatmap.2(as.matrix(dat.log),Colv=FALSE,lhei = c(0.25,4),ColSideColors=clustcol.height[clusters],density.info="none",scale="none",margin=c(10,10),col=hmcols,symkey=F,trace="none",dendrogram="none",keysize=1,hclust=hclustfunc,distfun=distfunc);
dev.off();
이 그림을 생성합니다. 어떻게 단축시킬 수 있습니까?
당신은 패키지 문서를 인용하는 것보다 좀 더 구체적으로 수하려고합니다. OP에주의를 기울이면 이미 '이'가 사용되고 있습니다. 1과 15의 논증은 무엇을 의미합니까? 라인 높이를 노골적으로 바꾸면 오류 메시지가 생성됩니다. l' : plot.new() 오류 : 그림 여백이 너무 큽니다. ' – posdef