79686793

Date: 2025-07-02 03:38:34
Score: 1.5
Natty:
Report link
dat<-as.data.frame(rexp(1000,0.2))
g <- ggplot(dat, aes(x = dat[,1])) 

g + geom_histogram(alpha = 0.2, binwidth = 5, colour = "black") +
 geom_line(stat = "bin", binwidth = 5, linewidth = 1)

I met the same problem. You define the stat = "bin" for geom_line. It will explain the caculation of geom_line as geom_histogram or geom_freqpoly.

Result:

enter image description here

Reasons:
  • Blacklisted phrase (1): enter image description here
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Quang Hà Trần