Skip to content

huichen99/ggjournals

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ggjournals

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.

Installation

You can install the package from GitHub using:

remotes::install_github("huichen99/ggjournals")

Example

Lancet Theme

Similarly, you can use the Lancet theme:

library(ggjournals)
library(ggplot2)

ggplot(mpg, aes(x = displ, y = hwy)) +
  geom_point() +
  theme_lancet()

NEJM Theme

library(ggjournals)
library(ggplot2)

ggplot(mpg, aes(x = class, y = hwy)) +
  geom_boxplot() +
  theme_nejm()

JAMA Theme

library(ggjournals)
library(ggplot2)

ggplot(mpg, aes(x = class, y = hwy)) +
  geom_boxplot() +
  theme_jama()

BMJ Theme

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()

About

Customized ggplot2 themes for journal styles

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages