颜色来源,有人在群里问如下一个问题,咦,然后我就看到了cm.colors这个颜色版,就去跑了一下他的代码
## 以下两个参数其实不加还好看点
rc <- rainbow(nrow(x),start = 0, end = .3)
cc <- rainbow(ncol(x),start = 0, end = .3)
hv <- heatmap(x, col = cm.colors(256), scale = "column",RowSideColors = rc, ColSideColors = cc ,margins = c(5,10),xlab = "specification variables",ylab = "Car Models",main = "heatmap(<Mtcars data>, ..., scale = \"column\")")
library (pheatmap)
ljj_3 <- read.table("E://desktop/七月desktop/李佳佳热图/ljj_end.txt", header = T, sep = "\t")
ljj_3[,2:ncol(ljj_3)] -> data
rownames(data) <- ljj_3[,1]
pheatmap(data,scale="row",cellwidth=20,cellheight=8,
cluster_col = T,cluster_row= T,
main="",
fontsize=10,treeheight_row = 2,show_rownames= F,
cutree_row=6,display_numbers = FALSE,
col = cm.colors(256),
clustering_distance_rows = "correlation",
border_color=NA)
## 重点是 col = cm.colors(256) 这个参数,妈妈再也不担心我的热图画的太丑了(虽然有时候很大程度是数据的问题)
哈哈哈 ,可能个人的品色不一样,起码我是觉得挺好看的。。