Open bagcik1lumc opened 1 year ago
upset(
movies, genres,
base_annotations=list('Either here'=intersection_size() + ylab('Or by adding ylab')),
set_sizes=upset_set_size() + ylab('My set size')
)
I am going to close this one as answered. Thanks for trying complex-upset!
Last, how can I remove the x-axis ticks on the left bottom plot, the y-axis ticks on the bar plot and show percentages on the left bottom plot? This concerns upset_set_size() I believe.
There is an example on modifying ticks under https://krassowski.github.io/complex-upset/articles/Examples_R.html#rotate-labels
As for percentages on set sizes, see below:
upset(
movies, genres, width_ratio=0.5, max_size=100, min_size=15, wrap=TRUE,
set_sizes=(
upset_set_size(
mapping=aes(y=..count../max(..count..)),
)
+ scale_y_reverse(labels=scales::percent_format())
+ ylab('Size relative to the largest')
)
)
Reopening as these examples should be added to the documentation.
I've seen the example, but it does not explain how to remove the y-ticks in the base_annotations. If I add theme(axis.ticks.y=element_blank()) it will remove the whole bar plot
If I add theme(axis.ticks.y=element_blank()) it will remove the whole bar plot
This would be unexpected. It works for me. Can you provide an example?
upset(
movies, genres,
base_annotations=list(
'Size'=(
intersection_size()
+ theme(axis.ticks.y=element_blank())
)
)
)
upset(
head(M4_BinaryMatrix, 100),
colnames(M4_BinaryMatrix),
base_annotations = list('Intersection size'=intersection_size(text_mapping=aes(label=paste0(round(
!!get_size_mode('exclusive_intersection')/!!get_size_mode('inclusive_union') * 100
), '%')))
+ ylab("")
+ theme(axis.ticks.y=element_blank(), plot.background=element_rect(fill='#E5D3B3'))),
name = "",
annotations = list(),
themes = upset_themes,
stripes = upset_stripes(),
labeller = identity,
height_ratio = 0.5,
width_ratio = 0.3,
wrap = FALSE,
set_sizes=(
upset_set_size(
mapping=aes(y=..count../max(..count..)),
)
+ scale_y_reverse(labels=scales::percent_format())
+ ylab("")
+ theme(axis.text.x = element_blank())
),
mode = "distinct",
queries = list(),
guides = NULL,
encode_sets = TRUE,
matrix = intersection_matrix(),
n_intersections=5
) +
labs(title = "",
caption = "")
I would also like to add percentages next or onto the bars, instead of on the x-scale.
Just swap ..count..
in the 4.4 Display counts example with the formula of choice for percentage, e.g. ..count../max(..count..)
.
How can I change the labels "Set size" and "Intersection size" into something custom?