Title: | Globe and Mail Graphics Theme for 'ggplot2' |
---|---|
Description: | Theme and colour palettes for The Globe and Mail's graphics. Includes colour and fill scale functions, colour palette helpers and a Globe-styled 'ggplot2' theme object. |
Authors: | Tom Cardoso [aut, cre] (creator and maintainer) |
Maintainer: | Tom Cardoso <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.0 |
Built: | 2024-11-13 02:57:41 UTC |
Source: | https://github.com/globeandmail/tgamtheme |
Color scale constructor for The Globe and Mail's colors
scale_color_tgam(palette = "main", discrete = TRUE, reverse = FALSE, ...) scale_colour_tgam(palette = "main", discrete = TRUE, reverse = FALSE, ...)
scale_color_tgam(palette = "main", discrete = TRUE, reverse = FALSE, ...) scale_colour_tgam(palette = "main", discrete = TRUE, reverse = FALSE, ...)
palette |
Character name of palette in tgam_palettes. Currently, one of 'main' or 'alternate'. |
discrete |
Boolean indicating whether color aesthetic is discrete or not |
reverse |
Boolean indicating whether the palette should be reversed |
... |
Additional arguments passed to discrete_scale() or scale_color_gradientn(), used respectively when discrete is TRUE or FALSE |
A ggplot2 colour scale object, to be passed to a ggplot2 object
library(ggplot2) ggplot(diamonds, aes(depth, color = cut)) + geom_density() + xlim(55, 70) + scale_color_tgam()
library(ggplot2) ggplot(diamonds, aes(depth, color = cut)) + geom_density() + xlim(55, 70) + scale_color_tgam()
Fill scale constructor for The Globe and Mail's colors
scale_fill_tgam(palette = "main", discrete = TRUE, reverse = FALSE, ...)
scale_fill_tgam(palette = "main", discrete = TRUE, reverse = FALSE, ...)
palette |
Character name of palette in tgam_palettes. Currently, one of 'main' or 'alternate'. |
discrete |
Boolean indicating whether color aesthetic is discrete or not |
reverse |
Boolean indicating whether the palette should be reversed |
... |
Additional arguments passed to discrete_scale() or scale_fill_gradientn(), used respectively when discrete is TRUE or FALSE |
A ggplot2 colour scale object, to be passed to a ggplot2 object
library(ggplot2) ggplot(diamonds, aes(carat, fill = cut)) + geom_density(position = 'fill') + scale_fill_tgam()
library(ggplot2) ggplot(diamonds, aes(carat, fill = cut)) + geom_density(position = 'fill') + scale_fill_tgam()
Function to extract The Globe and Mail's colors as hex codes
tgam_cols(...)
tgam_cols(...)
... |
Character names of tgam_colors. Colour names include 'burgundy', 'sky', 'salmon', 'gold', 'gray', 'alt1', 'alt2', 'alt3', 'alt4', 'alt5'. |
A character vector of one or more colours in The Globe's palette
tgam_cols() tgam_cols('burgundy')
tgam_cols() tgam_cols('burgundy')
Return function to interpolate a Globe and Mail color palette
tgam_pal(palette = "main", reverse = FALSE, ...)
tgam_pal(palette = "main", reverse = FALSE, ...)
palette |
Character name of palette in tgam_palettes. Currently, one of 'main' or 'alternate'. |
reverse |
Boolean indicating whether the palette should be reversed |
... |
Additional arguments to pass to colorRampPalette() |
A character vector of interpolated colour values
tgam_pal()(3) tgam_pal(palette = 'alternate')(3)
tgam_pal()(3) tgam_pal(palette = 'alternate')(3)
Theme function to be passed as an argument during ggplot2 charting.
theme_tgam( size = 12, family = "GMsanC-Regular", title = "GMsanC-Bold", position = "center" )
theme_tgam( size = 12, family = "GMsanC-Regular", title = "GMsanC-Bold", position = "center" )
size |
Base font size |
family |
Font family |
title |
Font to use for title text |
position |
How should headings be positioned? Options are 'center' or 'left'. (Default: 'center',) |
A ggplot2 theme object, to be passed to a ggplot2 object