.build_options {ggplot2}R Documentation

Set ggplot options

Description

Set global options for ggplot.

Usage

.build_options(opt)

Arguments

opt list of options to get/set

Details

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.

Colour settings:

Strip settings

Legend settings

Other settings:

Author(s)

Hadley Wickham <h.wickham@gmail.com>

Examples

ggopt(background.fill = "black", background.color ="white") # all new plots will use this
p <- qplot(total_bill, tip, facet = smoker ~ sex, data=tips)
p
p$background.fill = "white"
p
p$strip.text.gp <- gpar(col="red", fontsize=15)
p$strip.gp <- gpar(fill="black")
p$background.fill <- "black"
p$background.colour <- "white"
p$grid.colour <- "white"
p$grid.fill <- "grey50"
p # a very ugly plot!
ggopt(background.fill = "white", background.color ="black")

p <- qplot(wt, mpg, data=mtcars, colour=factor(cyl))
p$legend.position <- c(0.9,0.9); p
p$legend.position <- c(0.5,0.5)
p$legend.justification <- "center"
p

[Package ggplot2 version 0.5.2 Index]