ggopt: Set global options for ggplot.

Description Usage Arguments Format Details Examples

Description

These are aliased into every plot object, so that p$grid.col will return the default grid colour, unless it has been overriden for a particular plot object. You can change the global options using the function, or the options for a specific plot by setting the values directly on the object. See the examples for more details.

Usage

1
2
3
4
5
6
7

Arguments

...

named options to set

theme

list of options set

Format

An object of class list of length 2.

Details

Colour settings:

Strip settings

Legend settings

Other settings:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# Change global options
ggopt(background.fill = "black", background.color ="white")
p <- ggpoint(ggplot(reshape::tips, smoker ~ sex,aesthetics = list(y = tip, x = total_bill)))
p

# Change individual plot options
p$background.fill = "white"
p
p$strip.text.gp <- grid::gpar(col="red", fontsize=8)
p$background.colour <- "pink"
p$grid.colour <- "green"
p$grid.fill <- "blue"
p # a very ugly plot!

# Use ggtheme(theme_default) to reset back to the
# default theme.
ggtheme(theme_default)

hadley/ggplot1 documentation built on Aug. 19, 2019, 2:42 p.m.