# NOT RUN {
data(titanic)
ggplot(data = titanic) +
geom_mosaic(aes(x = product(Class), fill = Survived), alpha = 0.3) +
geom_mosaic_jitter(aes(x = product(Class), color = Survived))
ggplot(data = titanic) +
geom_mosaic(aes(x = product(Class)), alpha = 0.1) +
geom_mosaic_jitter(aes(x = product(Class), color = Survived), drop_level = TRUE)
ggplot(data = titanic) +
geom_mosaic(alpha = 0.3, aes(x = product(Class, Sex), fill = Survived),
divider = c("vspine", "hspine", "hspine")) +
geom_mosaic_jitter(aes(x = product(Class, Sex), color = Survived),
divider = c("vspine", "hspine", "hspine"))
ggplot(data = titanic) +
geom_mosaic(alpha = 0.3, aes(x = product(Class), conds = product(Sex), fill = Survived),
divider = c("vspine", "hspine", "hspine")) +
geom_mosaic_jitter(aes(x = product(Class), conds = product(Sex), fill = Survived),
divider = c("vspine", "hspine", "hspine"))
# }
Run the code above in your browser using DataLab