0

This is my current code:

ggplot(data, aes(`left amplitude`)) +
  stat_bin(aes(y=..density..), breaks = seq(min(data$`left amplitude`), max(data$`left amplitude`), by = .1), color="white") +
  geom_line(stat="density", size = 1) + 
  scale_y_continuous(labels = percent, name = "percent") +
  theme_classic()

and I get a result as

my result

But I need a normal curve more like this but remain y-axis with Percentage not Density.

image

Any suggestions?

Jason
  • 1
  • 1
  • 2
    Could you please include your data. You can use dput(data) and paste it here. – Shubham Oct 16 '22 at 14:17
  • hints: in addition to the stuff from the linked answer in the other comment, (1) experiment with the `breaks` argument (start by leaving it out entirely to use the default settings); (2) use `fill="white"` rather than `colour="white"` (3) use `+theme_gray()` to reset to the default theme – Ben Bolker Oct 16 '22 at 16:41

0 Answers0