Description Usage Arguments Value Examples
gg_remove_legend
Removes a plot's legend or some of its components
gg_remove_legend_title
Removes legend's title
gg_remove_legend_key
Removes legend's key
gg_remove_legend_text
Removes legend's item labels
gg_remove_legend_background
Removes legend's background
1 2 3 4 5 6 7 8 9 10 | gg_remove_legend(plot = last_plot(), title = TRUE, key = TRUE,
text = TRUE, background = TRUE)
gg_remove_legend_title(plot = last_plot())
gg_remove_legend_key(plot = last_plot())
gg_remove_legend_text(plot = last_plot())
gg_remove_legend_background(plot = last_plot())
|
plot |
A ggplot2 plot object. By default, the last plot displayed is used. |
title |
Whether or not to remove the legend's title
(default: |
key |
Whether or not to remove the legend's key
(default: |
text |
Whether or not to remove the legend's key text
(default: |
background |
Whether or not to remove the legend's background
(default: |
A modified ggplot2 plot
1 2 3 | p <- ggplot(mtcars, aes(x = cyl, y = mpg)) +
geom_point(shape = 1)
gg_remove_legend(plot = p)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.