加载R包
# install.packages("gplots")
library("gplots")
数据
mat <- matrix(rnorm(1200), ncol=6)
画图1
heatmap.2(x=mat)
画图2
heatmap.2(x=mat,
Colv=FALSE,
dendrogram="row",
scale="row",
col="bluered",
trace="none",
ColSideColors=rep(c("green","orange"), each=3),
labRow=FALSE,
main="my heatmap",
ylab="Genes",
xlab="Samples")
参考
- https://biocorecrg.github.io/CRG_RIntroduction/heatmap-2-function-from-gplots-package.html