krassowski / complex-upset

A library for creating complex UpSet plots with ggplot2 geoms
MIT License
469 stars 28 forks source link

How to change size of points and lines in matrix plot and define the color one time? #161

Open Sophia409 opened 2 years ago

Sophia409 commented 2 years ago

Hello,

1 I want to know how to change the point size and line size. where is this code in upset? In UpSet package, this can be applied by change point.size and line.size parameters. 2 BTW, is there any more simple methods to define the colors of sets and intersects?I did it by adding upset_query one by one. But this is very clumsy. In UpSet package, this can be applied by change main.bar.color and sets.bar.color parameter (just one time).

ComplexUpset::upset(a,colnames(a),intersections=list(c("human"), c("macaque"), c("mouse"), c("human", "macaque"), c("human", "mouse"),c("mouse", "macaque"),c("human", "macaque","mouse")),sort_intersections=FALSE, sort_sets=FALSE,height_ratio=0.6,width_ratio=0.2,
                    queries=list(
                      upset_query(intersect= 'human',fill = '#3182bd'),
                      upset_query(intersect= 'macaque', fill = '#31a354'),
                      upset_query(intersect= 'mouse', fill = '#FF0000'),
                      upset_query(intersect= c("human", "macaque"),fill = '#9ecae1'),
                      upset_query(intersect= c("human", "mouse"), fill = '#a1d99b'),
                      upset_query(intersect= c("mouse", "macaque"), fill = '#fc9272'),
                      upset_query(intersect= c("human", "macaque", "mouse"), fill = '#756bb1'),
                      upset_query(set = 'human', fill = '#3182bd'),
                      upset_query(set = 'macaque', fill = '#31a354'),
                      upset_query(set = 'mouse', fill = '#FF0000'))
)& theme(panel.background = element_blank())

image

Sophia409 commented 2 years ago

@krassowski

krassowski commented 2 years ago

Does main.bar.color allow to set colors of specific bars? How would you like the syntax to look like to achieve equivalent of what you have in a non-clumsy way?