I have some data that i want to make a histogram of. However, I want to represent this histogram with line. I have tried using the freq_poly
of the ggplot2
. However, the line produced is pretty jagged. I want to know if it is possible to use the splines
with ggplot2
, so that the line produced in freq_poly
will be smoother.
d <- rnorm( 1000 )
h <- hist( d, breaks="FD", plot=F )
plot( spline( h$mids, h$counts ), type="l" )
This is what i want to accomplish. But I want to do it using ggplot2
.