3 Matching Annotations
  1. Jan 2020
    1. As that example shows,

      Using geom_count() with position ='jitter' may help a bit with overplotting:

      ggplot(data = mpg) +

      • geom_count(mapping = aes(x = cty, y = hwy, color = class), position = "jitter")
    2. stat_violin()

      The ggplot2 v3.2.1 R documentation shows geom_violin() paired with stat_ydensity()

    3. The default stat of geom_bar() is stat_bin(). The geom_bar() function only expects an x variable. The stat, stat_bin(), preprocesses input data by counting the number of observations for each value of x. The y aesthetic uses the values of these counts.

      The ggplot2 v3.2.1 R documentation states "geom_bar() uses stat_count() by default". Was ggplot2 updated since this answer was published? My understanding is stat_count() is used for discrete x data and stat_bin() for continuous x data.