R语言绘制不同调色板的热力图

#------------------------------------------图7-4-1 热力图 方法2-----------------------------------------------------
library(gplots)
colormap <- colorRampPalette(rev(brewer.pal(n = 7, name = "Set1")))(100)

# order for rows
Rowv  <- mtcars %>% scale %>% dist %>% hclust %>% as.dendrogram %>%
  set("branches_k_color", k = 4) %>% set("branches_lwd", 1.2) %>%
  ladderize

# Order for columns
Colv  <- mtcars %>% scale %>% t %>% dist %>% hclust %>% as.dendrogram %>%
  set("branches_k_color", k = 2, value = c("orange", "blue")) %>%
  set("branches_lwd", 1.2) %>%
  ladderize

heatmap.2(scale(mtcars), scale = "none", col = colormap,
          Rowv = Rowv, Colv = Colv,
          trace = "none", density.info = "none")

R语言绘制不同调色板的热力图_第1张图片

colormap <- colorRampPalette(rev(brewer.pal(n = 7, name = "Set2")))(100)

R语言绘制不同调色板的热力图_第2张图片

colormap <- colorRampPalette(rev(brewer.pal(n = 7, name = "Set3")))(100)

R语言绘制不同调色板的热力图_第3张图片

colormap <- colorRampPalette(rev(brewer.pal(n = 7, name = "Dark2")))(100)

R语言绘制不同调色板的热力图_第4张图片

colormap <- colorRampPalette(rev(brewer.pal(n = 7, name = "Pastel1")))(100)

R语言绘制不同调色板的热力图_第5张图片

colormap <- colorRampPalette(rev(brewer.pal(n = 7, name = "Pastel2")))(100)

R语言绘制不同调色板的热力图_第6张图片

colormap <- colorRampPalette(rev(brewer.pal(n = 7, name = "Paired")))(100)

R语言绘制不同调色板的热力图_第7张图片

colormap <- colorRampPalette(rev(brewer.pal(n = 7, name = "Accent")))(100)

R语言绘制不同调色板的热力图_第8张图片

你可能感兴趣的:(r语言可视化,可视化,r语言,开发语言)