theme {ggplot2} | R Documentation |
Themes are a powerful way to customize the non-data components of
your plots: i.e. titles, labels, fonts, background, gridlines, and
legends. Themes can be used to give plots a consistent customized
look. Modify a single plot's theme using theme(); see themeupdate()
if you want modify the active theme, to affect all subsequent plots.
Use the themes available in complete themes if you would like to use
a complete theme such as themebw(), theme_minimal(), and more.
Theme elements are documented together according to inheritance, read
more about theme inheritance below.
theme(
text = NULL,
axis.text = NULL,
axis.title = NULL,
axis.line = "stroke: black; stroke-width: 5px; stroke-dash: solid;",
axis.text.x = NULL,
legend.background = "white",
legend.text = NULL,
legend.tick = NULL,
legend.title = NULL,
legend.split = 6,
plot.background = NULL,
plot.title = NULL,
panel.background = NULL,
panel.grid = "stroke: lightgray; stroke-width: 2px; stroke-dash: dash;",
panel.grid.major = "stroke: lightgray; stroke-width: 2px; stroke-dash: dash;",
panel.border = NULL);
Theme elements inherit properties from other theme elements hierarchically. For example, axis.title.x.bottom inherits from axis.title.x which inherits from axis.title, which in turn inherits from text. All text elements inherit directly or indirectly from text; all lines inherit from line, and all rectangular objects inherit from rect. This means that you can modify the appearance of multiple elements by setting a single high-level component. Learn more about setting these aesthetics In vignette("ggplot2-specs").