Created
October 27, 2019 11:35
-
-
Save juliuskittler/43f261a33b3dbe721bd142392c5df11f 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 = data.frame(x = c("Q1", "Q2", "Q3", "Q4", "Q1", "Q2", "Q3", "Q4"), | |
| y = c(1000, 2000, 4000, 8000, 500, 1000, 2000, 4000), | |
| type = c(rep("revenue", 4), rep("cost", 4))) | |
| ggplot(data = df, aes(x = x, y = y, fill = type)) + | |
| geom_col(position = "dodge", alpha = 0.8) + | |
| scale_fill_manual(values = c("grey", "steelblue4")) + | |
| labs(title = "Revenue and Costs by Quarter [in $1M]", y = "Revenue", x = "Quarter") + | |
| 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