Created
February 20, 2020 17:46
-
-
Save gkaramanis/a18438d624e495784af38932650c6abe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
ggplot(data = data.frame(x = c(-4, 6)), aes(x)) + | |
stat_function(fun = dnorm, n = 101, args = list(mean = 0, sd = 1), geom = "area", fill = "#F5BB87", alpha = 0.9) + | |
stat_function(fun = dnorm, n = 101, args = list(mean = 2.7, sd = 1), geom = "area", fill = "#BBD4EB", alpha = 0.9) + | |
coord_fixed(xlim = c(-5, 7), ratio = 8, clip = "off") + | |
annotate("segment", x = -3.9, y = 0, xend = 6, yend = 0, color = "grey60", size = 1.3) + | |
annotate("segment", x = -3.5, y = -0.04, xend = -3.5, yend = 0.42, color = "grey60", size = 1.3) + | |
annotate("text", x = 0, y = 0.18, label = "what people\nactually do\nin R", family = "Arial Bold", color = "white", size = 5.2) + | |
annotate("text", x = 2.75, y = 0.18, label = "what people\nassume others\ndo in R", family = "Arial Bold", color = "white", size = 5.2) + | |
annotate("text", x = -1.25, y = -0.03, label = "← less complicated", family = "Arial Bold", color = "grey60", size = 5.2) + | |
annotate("text", x = 3.25, y = -0.03, label = "more complicated →", family = "Arial Bold", color = "grey60", size = 5.2) + | |
theme_void() + | |
ggsave("~/Desktop/normal.png", width = 10, height = 4) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment