Skip to content

Instantly share code, notes, and snippets.

@dgkeyes
Created May 12, 2020 14:51
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 dgkeyes/6996b8c804cb9ddf5a19d148d2e42858 to your computer and use it in GitHub Desktop.
Save dgkeyes/6996b8c804cb9ddf5a19d148d2e42858 to your computer and use it in GitHub Desktop.
iris %>%
group_by(Species) %>%
summarize(mean_petal_width = mean(Petal.Width)) %>%
ungroup() %>%
ggplot(aes(Species, mean_petal_width,
fill = Species)) +
geom_col(show.legend = FALSE) +
theme_ipsum() +
scale_fill_manual(values = c("setosa" = "lightgray",
"versicolor" = "lightgray",
"virginica" = "red")) +
labs(x = NULL,
y = NULL,
title = "<span style = 'color: red;'>Virginica irises</span> have the largest average sepal width") +
theme(plot.title = element_markdown())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment