admin管理员组文章数量:1122832
I am now getting to grips with ComplexUpset and finding it very useful. I have a dataset I am applying it to which creates an excellent UpSet chart - very clear to those who need to use it. I cannot share that data, so I will have to speak in terms of the "movies" dataset. At each time this is required, there may be different sets of genres (e.g. 1997 may only have comedy, action and animation, 1998 may have comedy, action, animation, romance and drama). I currently have my timepoint set up so the sets are manually-coloured, but I would like to automate it if possible. I currently have the format:
upset(
movies,
colnames(movies)[18:20],
name='genre',
width_ratio=0.1,
matrix=(
intersection_matrix(geom=geom_point(shape='circle filled', size=3))
),
queries=list(
upset_query(set='Action', fill='red'),
upset_query(set='Animation', fill='blue'),
upset_query(set='Comedy', fill='yellow')
)
)
If the number and types of genres are changeable, then I will run into problems at other timepoints. So, rather than manually colouring them, is it possible to allow R to just choose from a colour scale? In my script, the UpSet "intersect" is controlled by colnames(), so that should always be correct to what I am analysing.
I have done similar with the vertical bars to differentiate the number of intersections (section below)
base_annotations=list(
'Intersection size'=intersection_size(
mapping=aes(fill=`Groups Count`)
) +
scale_fill_brewer(palette = "Set2") +
theme(legend.position = "right",
legend.title = element_text(size = 8,
family = "Trebuchet MS"),
element_text(family="Trebuchet MS"))
Can I apply something like scale_fill_brewer() to the horizontal bars and the circular intersection points?
本文标签: rComplexUpsetAssign any colour palette to sets and intersectionsStack Overflow
版权声明:本文标题:r - ComplexUpset - Assign any colour palette to sets and intersections - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736302900a1931696.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论