Extract plot components from a ggplot or gtable. get_plot_component()
extracts specific grobs or a list of grobs. Note that it omits zeroGrob
s and
returns NULL
if there is no non-zero grob to return. plot_component_names()
provides the names of the components in the plot. plot_components()
returns all
components as a list.
get_plot_component(plot, pattern, return_all = NA)
plot_component_names(plot)
plot_components(plot)
A grob or list of grobs (get_plot_component()
, plot_components()
)
or a character vector (plot_component_names()
)