Examples for 'ggmosaic::geom_mosaic_jitter'


Jittered dots in Mosaic plots.

Aliases: geom_mosaic_jitter stat_mosaic_jitter

Keywords:

### ** Examples

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))
Warning: `unite_()` was deprecated in tidyr 1.2.0.
ℹ Please use `unite()` instead.
ℹ The deprecated feature was likely used in the ggmosaic package.
  Please report the issue at <https://github.com/haleyjeppson/ggmosaic>.
This warning is displayed once every 8 hours.
Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
generated.
plot of chunk example-ggmosaic-geom_mosaic_jitter-1
ggplot(data = titanic) +
  geom_mosaic(aes(x = product(Class)), alpha = 0.1) +
  geom_mosaic_jitter(aes(x = product(Class), color = Survived), drop_level = TRUE)
Joining, by = "x__Class"
plot of chunk example-ggmosaic-geom_mosaic_jitter-1
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"))
plot of chunk example-ggmosaic-geom_mosaic_jitter-1
 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"))
plot of chunk example-ggmosaic-geom_mosaic_jitter-1

[Package ggmosaic version 0.3.3 Index]