theme_citihub: 'theme_citihub' A citihubernment theme for 'ggplot2'

Description Usage Arguments Details Value Examples

View source: R/theme_citihub.R

Description

theme_citihub Provides a theme for ggplot2 to produce Citihub style visualisations in ggplot2.

Usage

1
theme_citihub(axes = "x")

Arguments

axes

Character string. Specifies the presence or absence of axes Must be one of n (no axes), x (only x axis), y (only y axis), or xy (both axes shown).

base_size

Integer. Sets the base size of text for the plot. Defaults to 12.

base_colour

Character string. Sets the default colour of axes and axis labels. Must be a named R colour or hexadecimal colour code (e.g. "#FF0000"). Defaults to gray40.

Details

Builds on the 'grammar of graphics' framework implement in ggplot2. Applying theme_citihub() will adjust graphical parameters to give a plot a feel more in line with citihub.com.

Value

Will not return anything of itself, but when used in conjuntion with ggplot and (e.g.) geom_point from the package ggplot2, will apply styling to a plot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
library(ggplot2)
library(citihubstyle)
library(dplyr)

p <- mtcars %>%
   ggplot +
   aes(
   x = mpg,
   y = wt
   ) +
   geom_point()

# Plot without any theme applied

p

# Now apply citihub theme

p +
 theme_citihub()

whjelmar/citihubstyle documentation built on May 3, 2020, 1:42 p.m.