I have code that plot histograms.
library(ggplot2)
sample.range <- 50:150
mean <- 100
sd <- 15
set.seed(1)
n.samples <- c(1000, 10000)
my.df <- do.call(
rbind,
lapply(
n.samples,
function(x) data.frame(
"SampleSize" = x,
"control" = rnorm(x, mean, sd)
)
)
)
ggplot() +
geom_histogram(data = my.df, aes(x = control)) +
facet_wrap(.~SampleSize, scales = "free_y")
I want to get graphs exactly like in the attached picture. The green bar is mean.
[
Unfortunately, these are my first attempts to draw such complicated graphs, so please help me