gg-add: Modify a ggmatrix object by adding an ggplot2 object to all...

Description Usage Arguments Details See Also Examples

Description

This operator allows you to add ggplot2 objects to a ggmatrix object.

Usage

1
2
## S3 method for class 'gg'
e1 + e2

Arguments

e1

An object of class ggplot or theme

e2

A component to add to e1

Details

If the first object is an object of class ggmatrix, you can add the following types of objects, and it will return a modified ggplot object.

The + operator completely replaces elements with elements from e2.

See Also

+.gg and theme

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(tips, package = "reshape")
pm <- ggpairs(tips[, 2:3])
## change to black and white theme
pm + ggplot2::theme_bw()
## change to linedraw theme
# pm + ggplot2::theme_linedraw()
## change to custom theme
# pm + ggplot2::theme(panel.background = ggplot2::element_rect(fill = "lightblue"))
## add a list of information
extra <- list(ggplot2::theme_bw(), ggplot2::labs(caption = "My caption!"))
pm + extra

Example output

Loading required package: ggplot2
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

GGally documentation built on May 18, 2018, 1:08 a.m.