pheatmap修改热图scale bar

2021-12-08  本文已影响0人  余绕
test=read.csv("714.csv")
head(test)

bk <- c(seq(-0.8,-0.1,by=0.01),seq(0,0.8,by=0.01))

pheatmap(test,cluster_rows = F,cluster_cols = F,scale = "row",show_rownames = F,
           color = c(colorRampPalette(colors = c("darkseagreen1","white"))(length(bk)/2),colorRampPalette(colors = c("white","hotpink"))(length(bk)/2)),
         legend_breaks=seq(-0.8,1,0.8),
           breaks=bk)

这里 bk <- c(seq(-0.7,-0.1,by=0.01),seq(0,0.7,by=0.01))
color = c(colorRampPalette(colors = c("darkseagreen1","white"))(length(bk)/2),colorRampPalette(colors =
c("white","hotpink"))(length(bk)/2)),
legend_breaks=seq(-0.7,1,0.7),
breaks=bk

这几个参数用于修改热图的scale bar大小。其中bk <- c(seq(-0.7,-0.1,by=0.01),seq(0,0.7,by=0.01))里面的0.8要与legend_breaks=seq(-0.8,1,0.8),的0.8数字保持一致。这里修改的是进行row均一化后的数据。

上一篇下一篇

猜你喜欢

热点阅读