I'm plotting some data and have the following code:
ggplot(aes(x = x, y = y), data = data) +
geom_point(alpha = 1/15, color = 'blue')+
scale_y_continuous('y')+
scale_x_continuous('x')+
geom_smooth(stat = 'smooth', color = 'Red')
The graph looks like this:
But if I specify 'gam' in the the geom_smooth function, like:
geom_smooth(stat = 'smooth', color = 'Red', method = 'gam')
I get a different result:
Why is this happening?

