theme_general_dft: Displays a visual colour chart of a selected palette

View source: R/themeXDft.R

theme_general_dftR Documentation

Displays a visual colour chart of a selected palette

Description

Applies a standardised DfT theme to a ggplot.

Usage

theme_general_dft(
  legend_position = "bottom",
  base_family = "Arial",
  base_size = 14,
  base_line_size = 2,
  margin_sizes = c(2, 1, 1, 1)
)

Arguments

legend_position

the desired legend position. Selects bottom by default.

base_family

Font family

base_size

The base font size

base_line_size

The base line size

margin_sizes

The margin size in cm. Takes a list of the four margins in the order top, right, bottom, left.

Details

This theme has been designed using charting best practice principles.

Examples

## Not run: 
 ## Simple line plot using general theme with default options
 library(ggplot2)

 df <- economics_long[economics_long$variable %in% c("psavert", "uempmed"), ]
 # plot
 ggplot(df, aes(x=date)) +
   geom_line(aes(y=value, col=variable), size = 1) +
     theme_general_dft()
 
## End(Not run)


department-for-transport/dftplotr documentation built on April 3, 2024, 3:55 p.m.