I have four tibble composed by token and similarity.
# A tibble: 15 x 2
token similarity
<chr> <dbl>
1 beer 1.000
2 bud 0.495
3 answering 0.492
4 raw 0.489
5 tequila 0.476
6 shower 0.468
7 colors 0.468
8 flx 0.457
9 carrots 0.450
10 learn 0.447
11 pong 0.445
12 tall 0.444
13 drinking 0.444
14 brew 0.443
15 anything 0.442
Source code to group
beer %>%
mutate(selected = "beer") %>%
bind_rows(alcohol %>%
mutate(selected = "alcohol")) %>%
bind_rows(drunk %>%
mutate(selected = "drunk")) %>%
bind_rows(sober %>%
mutate(selected = "sober")) %>%
group_by(selected) %>%
top_n(15, similarity) %>%
ungroup %>%
mutate(token = reorder(token, similarity)) %>%
ggplot(aes(token, similarity, fill = selected)) +
geom_col(show.legend = FALSE) +
facet_wrap(~selected, scales = "free") +
coord_flip() +
theme(strip.text=element_text(hjust=0, size=12)) +
scale_y_continuous(expand = c(0,0))
When I try plot four groups, the graphic is cluttered:
How can I reorder the graphic?