The ggjournals package provides custom ggplot2 themes and color
palettes for creating plots that adhere to the styles of various medical
journals, including BMJ, The Lancet, NEJM, and JAMA. This package also
incorporates the color palettes from the ggsci package, which provides
a collection of high-quality color palettes inspired by scientific
journals.
You can install the package from GitHub using:
remotes::install_github("huichen99/ggjournals")Similarly, you can use the Lancet theme:
library(ggjournals)
library(ggplot2)
ggplot(mpg, aes(x = displ, y = hwy)) +
geom_point() +
theme_lancet()library(ggjournals)
library(ggplot2)
ggplot(mpg, aes(x = class, y = hwy)) +
geom_boxplot() +
theme_nejm()library(ggjournals)
library(ggplot2)
ggplot(mpg, aes(x = class, y = hwy)) +
geom_boxplot() +
theme_jama()To use the BMJ theme, simply add theme_bmj() to your ggplot2 plot:
library(ggjournals)
library(ggplot2)
ggplot(mpg, aes(x = displ, y = hwy)) +
geom_point() +
theme_bmj()


