Skip to contents

Theme for plots in publications, reports, Shiny apps, etc. Anywhere ggplot2 is used, you can use this theme!

Usage

theme_nrc(
  base_size = 12,
  colour = "Sand",
  legend = "none",
  markdown = FALSE,
  flipped = FALSE,
  legacy = FALSE
)

Arguments

base_size

The base size of text elements of the plot. (default 12)

colour

The background colour of the plot. Background colours are applied at 80% transparency. (default 'Soft Black')

legend

The position of the legend. (default "none")

markdown

[Experimental] Whether to use markdown formatting for plot titles (default FALSE)

flipped

Whether to flip the y-axis guide lines to show on the x-axis instead (default FALSE)

legacy

[Deprecated] Whether to use legacy fonts. This option will be removed sometime in the future.

Value

a ggplot2 theme

Examples

library(ggplot2)
df <- data.frame(x = c("One", "Two", "Three"), y = c(4, 2, 9))
p <- ggplot(df, aes(x = x, y = y, fill = x)) + geom_col()
p + theme_nrc()