Skip to content

Instantly share code, notes, and snippets.

@sebastiansauer
Created June 22, 2016 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebastiansauer/71a0398470a733760c08daa9c46af20b to your computer and use it in GitHub Desktop.
Save sebastiansauer/71a0398470a733760c08daa9c46af20b to your computer and use it in GitHub Desktop.
plot normal distribution with ggplot2, simply
# plot normal distribution with ggplot2, simply
library(cowplot)
p1 <- ggplot(data = data.frame(x = c(-3, 3)), aes(x)) +
stat_function(fun = dnorm, n = 101, args = list(mean = 0, sd = 1)) + ylab("") +
scale_y_continuous(breaks = NULL)
p1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment