The same binning as geom_histogram(), drawn as a line through the bin centres. Easier to overlay across groups than filled bars.

geom_freqpoly(
  mapping = NULL,
  data = NULL,
  bins = 30,
  binwidth = NULL,
  color = NULL,
  linewidth = NULL,
  alpha = NULL
)

Arguments

mapping, data

Standard layer overrides.

bins, binwidth

Binning, as in geom_histogram().

color, linewidth, alpha

Appearance.

Value

A Layer to add with +.

Examples

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