Package 'warwickplots'

Title: Palettes and Themes Consistent with The University of Warwick's Brand
Description: Colour palettes and a 'ggplot2' theme that are consistent with The University of Warwick' branding. Built using the 'palettes' package, which provides methods for printing, formatting, casting and coercion, extraction and updating of components, plotting, colour mixing arithmetic, and colour interpolation.
Authors: Ella Kaye [aut, cre]
Maintainer: Ella Kaye <[email protected]>
License: CC0
Version: 0.1.0
Built: 2024-11-20 05:05:56 UTC
Source: https://github.com/Warwick-Stats-Resources/warwickplots

Help Index


ggplot2 theme consistent with Warwick Brand

Description

theme_warwick() is an extension of ggplot2::theme_minimal(). See Details.

Usage

theme_warwick(base_size = 11, use = c("online", "print"))

Arguments

base_size

numeric, base size for font

use

character, one of "online" or "print" (defaults to "online"), which determines which font is used

Details

theme_warwick() is an extension of ggplot2::theme_minimal(), offering the following in addition:

  • Spacing, giving the text room to breathe

  • Uses ggtext::element_textbox_simple() for the plot title and subtitle, to enable use of markdown and CSS styling, and text-wrapping if the title/subtitle is long

  • Places the legend above the plot

  • Uses Lato or Avenir Next font (for online or print use respectively), if your system is set up for it

Note that any theme_warwick() defaults can be overridden with a subsequent call to theme().

For further details, including how to ensure your system is set up to use custom fonts, see the warwickplots vignette. For more examples, see the using warwickplots with ggplot2 vignette.

Examples

## Not run: 
ggplot2::ggplot(mtcars, ggplot2::aes(mpg, wt)) +
   ggplot2::geom_point() +
   ggplot2::labs(title = "A demo plot") +
   theme_warwick()

## End(Not run)

University of Warwick brand palettes

Description

Palettes consistent with The University of Warwick's brand.

Usage

warwick_palettes

warwick_palettes_discrete

warwick_palettes_sequential

warwick_palettes_divergent

Format

warwick_palettes

An object of class palettes_palette with 6 colour palettes.

warwick_palettes_discrete

An object of class palettes_palette with 1 discrete colour palettes.

warwick_palettes_sequential

An object of class palettes_palette with 3 sequential colour palettes.

warwick_palettes_divergent

An object of class palettes_palette with 2 sequential colour palettes.

Details

For more information on the University of Warwick's brand colours, see https://warwick.ac.uk/about/brand/brand-guidelines/colours/.

The primary palette is a combination of the primary brand colour (aubergine) and the five bright accent colours. These are the colours that the brand team uses for the graphs in their PowerPoint template.

The three sequential palettes run between the bright colour and its 30% tint.

Since the primary Warwick brand aubergine is much darker than the bright accent colours, it was too strong as a starting point for the aubergine side of the divergent palettes. To achieve a better balance, aubergine_ruby starts with an 80% tint of the primary aubergine, and aubergine_teal starts with a 70% tint.

Author(s)

Ella Kaye

Source

https://github.com/Warwick-Stats-Resources/warwickplots

See Also

pal_palette(), pal_colour()

Examples

# Get all palettes by name
names(warwick_palettes)

# Plot a specific palette
plot(warwick_palettes$primary)

# Subset a palette
warwick_palettes$primary[c(1, 3, 5)]

#' # Plot all palettes
## Not run: 
plot(warwick_palettes)

## End(Not run)