如何调整热图中颜色图例的位置.2
how to adjust the position of color legends in heatmap.2
我正在尝试使用以下代码进行无偏分层聚类
col.cell <- c("purple","orange", "green", "blue")[sampleinf$subtype]
heatmap.2(as.matrix(hm3),col=rev(morecols(50)),trace="none", main="Top 500 most variable genes across samples",ColSideColors=col.cell,scale="row")
legend("topright",
legend = unique(sampleinf$subtype),
col = col.cell,
lty= 1.5, lwd = 2,
cex=.6)
如何使颜色图例更明显。现在它与树状图叠加。
要在 0 到 1 的范围之外绘图,需要使用 par(xpd=TRUE)
legend(x = #,y= #, xpd = TRUE, legend("topright",
legend = unique(sampleinf$subtype),
col = col.cell,
lty= 1.5, lwd = 2,
cex=.6)
我正在尝试使用以下代码进行无偏分层聚类
col.cell <- c("purple","orange", "green", "blue")[sampleinf$subtype]
heatmap.2(as.matrix(hm3),col=rev(morecols(50)),trace="none", main="Top 500 most variable genes across samples",ColSideColors=col.cell,scale="row")
legend("topright",
legend = unique(sampleinf$subtype),
col = col.cell,
lty= 1.5, lwd = 2,
cex=.6)
如何使颜色图例更明显。现在它与树状图叠加。
要在 0 到 1 的范围之外绘图,需要使用 par(xpd=TRUE)
legend(x = #,y= #, xpd = TRUE, legend("topright",
legend = unique(sampleinf$subtype),
col = col.cell,
lty= 1.5, lwd = 2,
cex=.6)