Last active
October 27, 2019 11:30
-
-
Save juliuskittler/397e9a209804c7773c788a0b3bf4db07 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| df = ggplot2::diamonds # data frame with 1 character/factor variable | |
| ggplot(data = df, aes(x = cut, fill = color)) + | |
| geom_bar(position = "stack", alpha = 0.8) + # alternative: position = "dodge" | |
| labs(title = "Number of Diamonds by Cut and Color", y = "Count", x = "Cut") + | |
| theme_bw() + theme(plot.title = element_text(hjust = 0.5)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment