Created
September 17, 2019 03:14
-
-
Save dgkeyes/617baf386a1667b4dee1442b408aae92 to your computer and use it in GitHub Desktop.
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
library(tidyverse) | |
diamonds_summary <- diamonds %>% | |
count(cut) %>% | |
mutate(cut = factor(cut, levels = c("Fair", | |
"Good", | |
"Very Good", | |
"Premium", | |
"Ideal"))) %>% | |
mutate(cut = fct_rev(cut)) | |
ggplot(diamonds_summary, aes(1, n, | |
fill = cut)) + | |
geom_col() + | |
coord_flip() + | |
geom_text(aes(label = n), | |
position = position_stack(vjust = 0.5)) + | |
guides(fill = guide_legend(reverse = TRUE)) + | |
theme_void() + | |
theme(legend.position = "bottom") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How about:
???