ggplot_build

0th

Percentile

Build ggplot for rendering.

ggplot_build() takes the plot object, and performs all steps necessary to produce an object that can be rendered. This function outputs two pieces: a list of data frames (one for each layer), and a panel object, which contain all information about axis limits, breaks etc.

Keywords
internal
Usage
ggplot_build(plot)

layer_data(plot, i = 1L)

layer_scales(plot, i = 1L, j = 1L)

layer_grob(plot, i = 1L)

Arguments
plot

ggplot object

i

An integer. In layer_data(), the data to return (in the order added to the plot). In layer_grob(), the grob to return (in the order added to the plot). In layer_scales(), the row of a facet to return scales for.

j

An integer. In layer_scales(), the column of a facet to return scales for.

Details

layer_data(), layer_grob(), and layer_scales() are helper functions that return the data, grob, or scales associated with a given layer. These are useful for tests.

See Also

print.ggplot() and benchplot() for functions that contain the complete set of steps for generating a ggplot2 plot.

Aliases
  • ggplot_build
  • layer_data
  • layer_scales
  • layer_grob
Documentation reproduced from package ggplot2, version 3.2.0, License: GPL-2 | file LICENSE

Community examples

Looks like there are no examples yet.