Skip to content

Instantly share code, notes, and snippets.

@thomas-neitmann
Last active February 8, 2021 09:16
Show Gist options
  • Save thomas-neitmann/af42ab7a7f2c4699d0f48dfa8035577f to your computer and use it in GitHub Desktop.
Save thomas-neitmann/af42ab7a7f2c4699d0f48dfa8035577f to your computer and use it in GitHub Desktop.
library(ggplot2)
library(dplyr)
data(biomedicalrevenue, package = "ggcharts")
plot <- biomedicalrevenue %>%
filter(company %in% c("Roche", "Novartis")) %>%
ggplot(aes(year, revenue, color = company)) +
geom_line(size = 1.2) +
ggtitle(
paste0(
"<span style = 'color:#93C1DE'>**Roche**</span>",
" *overtook* <span style = 'color:darkorange'>**Novartis**</span>",
" in 2016"
)
) +
scale_color_manual(
values = c("Roche" = "#93C1DE", "Novartis" = "darkorange"),
guide = "none"
) +
ggcharts::theme_hermit(ticks = "x", grid = "X") +
theme(plot.title = ggtext::element_markdown())
plot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment