This repository was archived by the owner on Apr 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy paththeme_gov.Rd
59 lines (49 loc) · 1.45 KB
/
theme_gov.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/theme_gov.R
\name{theme_gov}
\alias{theme_gov}
\title{\code{theme_gov} A government theme for \code{ggplot2}}
\usage{
theme_gov(base_size = 12, base_colour = "gray40", axes = "x")
}
\arguments{
\item{base_size}{Integer. Sets the base size of text for the plot.
Defaults to \code{12}.}
\item{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 \code{gray40}.}
\item{axes}{Character string. Specifies the presence or absence of axes
Must be one of \code{n} (no axes), \code{x} (only x axis), \code{y}
(only y axis), or \code{xy} (both axes shown).}
}
\value{
Will not return anything of itself, but when used in conjuntion
with \code{\link{ggplot}} and (e.g.) \code{\link{geom_point}} from the
package \code{ggplot2}, will apply styling to a plot.
}
\description{
\code{theme_gov} Provides a theme for ggplot2 to produce
government style visualisations in \code{ggplot2}.
}
\details{
Builds on the 'grammar of graphics' framework implement in
ggplot2. Applying \code{theme_gov()} will adjust graphical parameters
to give a plot a feel more in line with gov.uk.
}
\examples{
library(ggplot2)
library(govstyle)
library(dplyr)
p <- mtcars \%>\%
ggplot +
aes(
x = mpg,
y = wt
) +
geom_point()
# Plot without any theme applied
p
# Now apply gov theme
p +
theme_gov()
}