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 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/theme-defaults.R
\name{ggtheme}
\alias{theme_grey}
\alias{theme_gray}
\alias{theme_bw}
\alias{theme_linedraw}
\alias{theme_light}
\alias{theme_dark}
\alias{theme_minimal}
\alias{theme_classic}
\alias{theme_void}
\alias{theme_test}
\title{Complete themes}
\usage{
theme_grey(
base_size = 11,
base_family = "",
base_line_size = base_size/22,
base_rect_size = base_size/22
)
theme_gray(
base_size = 11,
base_family = "",
base_line_size = base_size/22,
base_rect_size = base_size/22
)
theme_bw(
base_size = 11,
base_family = "",
base_line_size = base_size/22,
base_rect_size = base_size/22
)
theme_linedraw(
base_size = 11,
base_family = "",
base_line_size = base_size/22,
base_rect_size = base_size/22
)
theme_light(
base_size = 11,
base_family = "",
base_line_size = base_size/22,
base_rect_size = base_size/22
)
theme_dark(
base_size = 11,
base_family = "",
base_line_size = base_size/22,
base_rect_size = base_size/22
)
theme_minimal(
base_size = 11,
base_family = "",
base_line_size = base_size/22,
base_rect_size = base_size/22
)
theme_classic(
base_size = 11,
base_family = "",
base_line_size = base_size/22,
base_rect_size = base_size/22
)
theme_void(
base_size = 11,
base_family = "",
base_line_size = base_size/22,
base_rect_size = base_size/22
)
theme_test(
base_size = 11,
base_family = "",
base_line_size = base_size/22,
base_rect_size = base_size/22
)
}
\arguments{
\item{base_size}{base font size, given in pts.}
\item{base_family}{base font family}
\item{base_line_size}{base size for line elements}
\item{base_rect_size}{base size for rect elements}
}
\description{
These are complete themes which control all non-data display. Use
\code{\link[=theme]{theme()}} if you just need to tweak the display of an existing
theme.
}
\details{
\describe{
\item{\code{theme_gray()}}{
The signature ggplot2 theme with a grey background and white gridlines,
designed to put the data forward yet make comparisons easy.}
\item{\code{theme_bw()}}{
The classic dark-on-light ggplot2 theme. May work better for presentations
displayed with a projector.}
\item{\code{theme_linedraw()}}{
A theme with only black lines of various widths on white backgrounds,
reminiscent of a line drawing. Serves a purpose similar to \code{theme_bw()}.
Note that this theme has some very thin lines (<< 1 pt) which some journals
may refuse.}
\item{\code{theme_light()}}{
A theme similar to \code{theme_linedraw()} but with light grey lines and axes,
to direct more attention towards the data.}
\item{\code{theme_dark()}}{
The dark cousin of \code{theme_light()}, with similar line sizes but a dark background. Useful to make thin coloured lines pop out.}
\item{\code{theme_minimal()}}{
A minimalistic theme with no background annotations.}
\item{\code{theme_classic()}}{
A classic-looking theme, with x and y axis lines and no gridlines.}
\item{\code{theme_void()}}{
A completely empty theme.}
\item{\code{theme_test()}}{
A theme for visual unit tests. It should ideally never change except
for new features.}
}
}
\examples{
mtcars2 <- within(mtcars, {
vs <- factor(vs, labels = c("V-shaped", "Straight"))
am <- factor(am, labels = c("Automatic", "Manual"))
cyl <- factor(cyl)
gear <- factor(gear)
})
p1 <- ggplot(mtcars2) +
geom_point(aes(x = wt, y = mpg, colour = gear)) +
labs(
title = "Fuel economy declines as weight increases",
subtitle = "(1973-74)",
caption = "Data from the 1974 Motor Trend US magazine.",
tag = "Figure 1",
x = "Weight (1000 lbs)",
y = "Fuel economy (mpg)",
colour = "Gears"
)
p1 + theme_gray() # the default
p1 + theme_bw()
p1 + theme_linedraw()
p1 + theme_light()
p1 + theme_dark()
p1 + theme_minimal()
p1 + theme_classic()
p1 + theme_void()
# Theme examples with panels
\donttest{
p2 <- p1 + facet_grid(vs ~ am)
p2 + theme_gray() # the default
p2 + theme_bw()
p2 + theme_linedraw()
p2 + theme_light()
p2 + theme_dark()
p2 + theme_minimal()
p2 + theme_classic()
p2 + theme_void()
}
}
\seealso{
The \href{https://ggplot2-book.org/themes#sec-themes}{complete themes section} of the online ggplot2 book.
}
|