0

I can plot a histogram (with absolute counts) of my data using geom_histogram, but this gives me bars, not a smooth line.

I can use geom_density to get a smooth line, but the axis is frequency, not counts.

Is it possible to get a smooth histogram with absolute counts on the y axis with ggplot?

Superbest
  • 25,318
  • 14
  • 62
  • 134
  • 4
    I'm guessing you want a _scaled_ density plot, maybe? e.g. `geom_density(aes(y = ..count..))`? – joran Nov 03 '15 at 23:24
  • @joran Yes, that's exactly what I want, thank you! By the way, what is the `..count..` syntax? What do the dots mean? – Superbest Nov 03 '15 at 23:26
  • It's just a somewhat obtuse way to avoid name collisions. See `?stat_density`, including the Value section and the examples and you'll see it in use. – joran Nov 03 '15 at 23:28

0 Answers0