I need to change the axis breaks in geom_mosaic
.
Here is my example:
my_tibble <-
tibble(a=rep(c("a1","a2"),each=4),
b=rep(rep(c("b1","b2"),each=2),times=2),
c=rep(c("c1","c2"),times=4),
x=seq_along(b)
)
my_tibble |>
ggplot() +
geom_mosaic(aes(x=product(a,b,c),weight=x,fill=a),
divider=c("vspine","hspine","hspine"))
I want only the labels of the outer grouping variable, like this
Can this be achieved with simple function calls in geom_mosaic
?