在UpSetR中使用调色板作为矩阵点

时间:2017-09-14 15:39:21

标签: r color-palette upsetr

下面我构建了一个Upset plot。我正在使用颜色调色板来定义条形颜色。有没有办法对连接点的矩阵进行此操作?

library(dplyr)
library(RColorBrewer)
library(UpSetR)

movies <- read.csv(system.file("extdata", "movies.csv",
                   package = "UpSetR"), header=T, sep=";" )
movies <- select(movies, Action:Children)

upset(movies, main.bar.color=brewer.pal(2^ncol(movies)-1, "Set1"))

enter image description here

当尝试将调色板应用于矩阵时,我会收到警告,并且只使用第一种颜色红色。

upset(movies, main.bar.color=brewer.pal(2^ncol(movies)-1, "Set1"),
      matrix.color=brewer.pal(2^ncol(movies)-1, "Set1"))

enter image description here

1 个答案:

答案 0 :(得分:3)

proxy_pass只允许为upset指定一种颜色 解决方案是修改matrix.color函数:

UpSetR:::Create_layout

enter image description here

相关问题