Skip to content

Instantly share code, notes, and snippets.

@darioappsilon
Created May 6, 2022 10:11
Show Gist options
  • Save darioappsilon/5b9533b4b4a472a03a8f04924764abaa to your computer and use it in GitHub Desktop.
Save darioappsilon/5b9533b4b4a472a03a8f04924764abaa to your computer and use it in GitHub Desktop.
ggplot(data, aes(x = quarter, y = profit, fill = product)) +
geom_col(position = position_dodge()) +
scale_fill_manual(values = c("#3db5ff", "#0099f9")) +
geom_text(aes(label = profit), position = position_dodge(0.9), vjust = 2, size = 4, color = "#ffffff") +
geom_hline(yintercept = mean(data$profit), linetype = "dashed", size = 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment