hist_usq: Basic histograms using USQ colours and typography

Description Usage Arguments Details References See Also Examples

View source: R/hist_usq.R

Description

Basic histograms that follow USQ colour and typography guidelines that uses (hopefully) sensible defaults.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
hist_usq(
  x,
  main = "",
  sub = "",
  xlab = "",
  ylab = "Count",
  breaks = "pretty",
  col = "usq charcoal",
  ...
)

Arguments

x

a vector of values for which the histogram is desired.

main

Main title. Optional, if not supplied it will be blank.

sub

Sub title below x-axis label. Optional, if not supplied it will be blank.

xlab

X-axis label. Optional, if not supplied will be taken from data.

ylab

Y-axis label. Optional, if not supplied will default to "Count".

breaks

Either pretty, default, or exact. Pretty uses Scott's Rule, whereas exact uses a bin-width of 1 so each value is represented individually with a bar.

col

Colour to use as fill and outline for boxes and outlier points as a digit. Defaults to "usq charcoal". There are fifteen colours that can be used, see Details for more.

...

Arguments to be passed to methods, such as graphical parameters (see par).

Details

Names of colours for use in plots from the USQ Visual Identity Palette are available from link{usq_cols}.

References

Scott, D.W. (1979) On optimal and data-based histograms. Biometrika, 66, 605–610.

Hyndman, R. J., The Problem with Sturges’ Rule for Constructing Histograms, 1995, Monash University, https://www.robjhyndman.com/papers/sturges.pdf.

See Also

hist for full documentation of the basic histogram capabilities

Examples

1

adamhsparks/theme.usq documentation built on Nov. 20, 2020, 8:11 a.m.