Description Usage Arguments Value Examples
gg_remove_titles
removes title elements such as the main title,
subtitle, caption, or axis titles. By default, all are removed.
gg_remove_title
Removes the plot's main title
gg_remove_subtitle
Removes the plot's subtitle
gg_remove_caption
Removes the plot caption
gg_remove_title.x
Removes the X-axis title
gg_remove_title.y
Removes the Y-axis title
1 2 3 4 5 6 7 8 9 10 11 12 | gg_remove_titles(plot = last_plot(), title = TRUE, subtitle = TRUE,
caption = TRUE, x = TRUE, y = TRUE)
gg_remove_title(plot = last_plot())
gg_remove_subtitle(plot = last_plot())
gg_remove_caption(plot = last_plot())
gg_remove_title.x(plot = last_plot())
gg_remove_title.y(plot = last_plot())
|
plot |
A ggplot2 plot object. By default, the last plot displayed is used. |
title |
Whether or not to remove the main title (default: |
subtitle |
Whether or not to remove the subtitle (default: |
caption |
Whether or not to remove the caption (default: |
x |
Whether or not to remove the X axis title (default: |
y |
Whether or not to remove the Y axis title (default: |
A modified ggplot2 plot
1 2 3 4 5 6 7 8 | p <- ggplot(mtcars, aes(x = cyl, y = mpg)) +
geom_point(shape = 1) +
labs(title = "Fuel Efficiency by Engine Type",
subtitle = "Larger engines are less efficient",
caption = "Source: Motor Trend",
x = "Number of Cylinders",
y = "Fuel Efficiency (MPG)")
gg_remove_titles(plot = p)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.