Last active
February 8, 2021 09:16
-
-
Save thomas-neitmann/af42ab7a7f2c4699d0f48dfa8035577f 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(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