Simple Regression Line is Slightly Jagged

Hi there,

I am assuming you're on a windows system. The best way to solve this problem is to change the graphic device you're using. I have found that cairo works really well for this.

See example below of how to force cairo as your graphics device

ggplot(iris, aes(x = Petal.Width, y = Sepal.Length)) + 
    geom_point() +
    stat_smooth(method = "lm", col = "red") + 
    labs(title = "Normal") +
    ggsave("normal.png") +
    labs(title = "Cairo") +
    ggsave("cairo.png", type = "cairo")

Here you can see an example too: "cairo" as default in ggsave & RStudio Plots pane in Windows?