gg_remove_background: Remove a plot's background.

Description Usage Arguments Value Examples

Description

gg_remove_background removes the background from the given plot. This is useful for creating plots with transparent backgrounds

gg_remove_background_canvas Removes TODO

gg_remove_background_panel Removes TODO

gg_remove_background_legend Removes TODO

gg_remove_background_facet Removes TODO

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
gg_remove_background(plot = last_plot(), canvas = TRUE, panel = FALSE,
  legend = FALSE, facet = FALSE)

gg_remove_background_canvas(plot = last_plot())

gg_remove_background_panel(plot = last_plot())

gg_remove_background_legend(plot = last_plot())

gg_remove_background_facet(plot = last_plot())

Arguments

plot

A ggplot2 plot object. By default, the last plot displayed is used.

canvas

Whether or not to remove the background from the entire image (default: TRUE)

panel

Whether or not to remove the background from the panel (i.e., the plotting area; default: FALSE)

legend

Whether or not to remove the legend's background (default: FALSE)

facet

Whether or not to remove the background from facet labels (default: FALSE)

Value

A modified ggplot2 plot

Examples

1
2
3
p <- ggplot(mtcars, aes(x = cyl, y = mpg)) +
    geom_point(shape = 1)
gg_remove_background(plot = p)

briandconnelly/ggplot2bdc documentation built on May 13, 2019, 5:13 a.m.