class_docstr: Create a new ggplot object
  
  Parameters
  ----------
  data :
      Default data for plot. Every layer that does not
      have data of its own will use this one.
  mapping :
      Default aesthetics mapping for the plot. These will be used
      by all layers unless specifically overridden.
  
  Notes
  -----
  ggplot object only have partial support for pickling. The mappings used
  by pickled objects should not reference variables in the namespace.
class_docstr_tok: ["Create","a","new","ggplot","object","Parameters","--","--","--","--","--","data",":","Default","data","for","plot",".","Every","layer","that","does","not","have","data","of","its","own","will","use","this","one",".","mapping",":","Default","aesthetics","mapping","for","the","plot",".","These","will","be","used","by","all","layers","unless","specifically","overridden",".","Notes","--","--","-","ggplot","object","only","have","partial","support","for","pickling",".","The","mappings","used","by","pickled","objects","should","not","reference","variables","in","the","namespace","."]
docstr: Build ggplot for rendering.
  
  Notes
  -----
  This method modifies the ggplot object. The caller is
  responsible for making a copy and using that to make
  the method call.
docstr_tok: ["Build","ggplot","for","rendering",".","Notes","--","--","-","This","method","modifies","the","ggplot","object",".","The","caller","is","responsible","for","making","a","copy","and","using","that","to","make","the","method","call","."]
code: def _build(self):
      """
      Build ggplot for rendering.
  
      Notes
      -----
      This method modifies the ggplot object. The caller is
      responsible for making a copy and using that to make
      the method call.
      """
      if not self.layers:
          self += geom_blank()
  
      layers = self._build_objs.layers = self.layers
      scales = self._build_objs.scales = self.scales
      layout = self._build_objs.layout = self.layout
  
      # Update the label information for the plot
      layers.update_labels(self)
  
      # Give each layer a copy of the data, the mappings and
      # the execution environment
      layers.setup(self)
  
      # Initialise panels, add extra data for margins & missing
      # facetting variables, and add on a PANEL variable to data
      layout.setup(layers, self)
  
      # Compute aesthetics to produce data with generalised
      # variable names
      layers.compute_aesthetics(self)
  
      # Transform data using all scales
      layers.transform(scales)
  
      # Make sure missing (but required) aesthetics are added
      scales.add_missing(("x", "y"))
  
      # Map and train positions so that statistics have access
      # to ranges and all positions are numeric
      layout.train_position(layers, scales)
      layout.map_position(layers)
  
      # Apply and map statistics
      layers.compute_statistic(layout)
      layers.map_statistic(self)
  
      # Prepare data in geoms
      # e.g. from y and width to ymin and ymax
      layers.setup_data()
  
      # Apply position adjustments
      layers.compute_position(layout)
  
      # Reset position scales, then re-train and map.  This
      # ensures that facets have control over the range of
      # a plot.
      layout.reset_position_scales()
      layout.train_position(layers, scales)
      layout.map_position(layers)
  
      # Train and map non-position scales
      npscales = scales.non_position_scales()
      if len(npscales):
          layers.train(npscales)
          layers.map(npscales)
  
      # Train coordinate system
      layout.setup_panel_params(self.coordinates)
  
      # fill in the defaults
      layers.use_defaults()
  
      # Allow stats to modify the layer data
      layers.finish_statistics()
  
      # Allow layout to modify data before rendering
      layout.finish_data(layers)
  
imports: from __future__ import annotations
  import typing
  from collections.abc import Sequence
  from copy import copy, deepcopy
  from io import BytesIO
  from itertools import chain
  from pathlib import Path
  from types import SimpleNamespace
  from typing import Any, Dict, Iterable, Optional
  from warnings import warn
  from ._utils import from_inches, is_data_like, order_as_data_mapping, to_inches, ungroup
  from ._utils.context import plot_context
  from ._utils.ipython import get_display_function, get_ipython, is_inline_backend
  from .coords import coord_cartesian
  from .exceptions import PlotnineError, PlotnineWarning
  from .facets import facet_null
  from .facets.layout import Layout
  from .geoms.geom_blank import geom_blank
  from .guides.guides import guides
  from .iapi import mpl_save_view
  from .layer import Layers
  from .mapping.aes import aes, make_labels
  from .options import get_option
  from .scales.scales import Scales
  from .themes.theme import theme, theme_get
label_desc: Use image node_id 13 for calling the ggplot obj's underlying member method code with example usage: obj._build() without return types