A histogram built from one dot per observation, stacked within its bin. Better than bars for small samples, where it shows every data point.

geom_dotplot(
  mapping = NULL,
  data = NULL,
  binwidth = NULL,
  color = NULL,
  size = NULL,
  alpha = NULL
)

Arguments

mapping, data

Standard layer overrides. Map the values to x.

binwidth

Bin width in data units.

color, size, alpha

Appearance.

Value

A Layer to add with +.

Examples

ggnext(cars, aes(speed)) + geom_dotplot(binwidth = 2)
#> <ggnext plot>
#>   data:  50 x 2
#>   aes:   x = speed
#>   layers: 1 
#>   coord: cartesian
#>   mode:  static