theme {ggplot2} R Documentation

Modify components of a theme

Description


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 theme
bw(), theme_minimal(), and more.

Theme elements are documented together according to inheritance, read
more about theme inheritance below.

Usage

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);

Arguments

axis.text

[as textElement]

text

all text elements (element_text()). [as textElement]

plot.background

background of the entire plot (element_rect(); inherits from rect). [as string]

legend.background

background of legend (element_rect(); inherits from rect). [as string]

panel.background

background of plotting area, drawn underneath plot (element_rect(); inherits from rect). [as string]

legend.text

legend item labels (element_text(); inherits from text). [as textElement]

axis.line

lines along axes (element_line()). Specify lines along all axes (axis.line), lines for each plane (using axis.line.x or axis.line.y), or individually for each axis (using axis.line.x.bottom, axis.line.x.top, axis.line.y.left, axis.line.y.right). axis.line.*.* inherits from axis.line.* which inherits from axis.line, which in turn inherits from line

Details

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").

Authors

SMRUCC genomics institute

Value

this function returns data object of type ggplotOption.

clr value class

Examples


[Package ggplot2 version 1.0.0.0 Index]