library(tidyverse)
cv <- 2.5
sigma = seq(0.2,5,by = 0.2)
list(mean = sigma / cv, sd = sigma) %>% transpose %>%
set_names(., nm = map_chr(., lift_dl(paste, sep="_"))) %>%
map(lift_dl(partial, .f = dnorm)) %>%
map_df(~ tibble(x = seq(-2,3.5,0.01),
y = .x(x)), .id = "mean_sd") %>%
ggplot(aes(x = x, ymax = y, ymin = 0, fill = mean_sd)) + geom_ribbon() +
scale_fill_viridis_d(option= "magma", direction = -1) +
theme_dark() +
guides(fill = FALSE)
Created on 2020-03-15 by the reprex package (v0.3.0)