I have a histogram and want to display a density plot line or area over it. It does not work with the following code.
The histogram is displayed the way i want but the geom_density() does not seem to work Note, i changed the column names to make it anonymous here on stack.
plot <- ggplot(data=df, aes(x=DFCOLUMN)) +
geom_histogram(binwidth=10, color="#0000FF", fill="white") +
geom_density(alpha=.5, fill="#FF6666") +
facet_grid(. ~ SOME OTHER COLUMN) +
coord_cartesian(xlim=c(0,600)) +
ggtitle("COLUMNAME") +
theme(panel.background = element_blank())
Can you come up with a fix?
Thank you