
Apply Publication Theme with Color Palette
Source:R/publication-themes.R
apply_publication_style.RdConvenience function that applies both publication theme and appropriate color palette.
Arguments
- plot
A ggplot object.
- theme_name
Character string specifying theme name.
- color_palette
Character string specifying color palette or vector of colors. Options: "clinical", "treatment", "severity", "outcome", "fda", or journal-specific palettes: "nejm", "nature", "lancet", "jama", "science", "jco".
- ...
Additional arguments passed to theme function.
Examples
if (FALSE) { # \dontrun{
library(ggplot2)
p <- ggplot(mtcars, aes(wt, mpg, color = factor(cyl))) + geom_point()
p_pub <- apply_publication_style(p, "nature", "clinical")
# Apply journal-specific theme and colors together
p_nejm <- apply_publication_style(p, "nejm", "nejm")
p_nature <- apply_publication_style(p, "nature", "nature")
p_lancet <- apply_publication_style(p, "lancet", "lancet")
} # }