Created
July 4, 2023 12:45
-
-
Save njudd/792f13e2932ae95c2d4355b6c393f9f9 to your computer and use it in GitHub Desktop.
Normal Density function plotted
This file contains 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
pl1 <- ggplot(df, aes(x)) + | |
geom_rect(aes(xmin = .8, xmax = 1.2, ymin = 0, ymax = 0.4, fill = "lightblue", alpha = .3)) + | |
stat_function(fun = dnorm, n = 200, args = list(mean = 0, sd = 1)) + | |
#geom_density(color = "darkblue", size = 1) + | |
theme_minimal(base_size = 12) + | |
theme(legend.position = "none") + | |
labs(y = "Density of participants (n = 200)", x = "Ability on a Task (SD)") + | |
scale_x_continuous(breaks = c(-3, -2, -1, 0, 1, 2, 3), limits = c(-3.5, 3.5)) | |
ggsave("~/Desktop/abilitychallange_s1.png", pl1, bg = "white", width = 8, height = 4) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment