code: def ggplot(data=None, mapping=None):
      """
      Create a new ggplot plot.
  
      Parameters
      ----------
      data : dict or Pandas or Polars `DataFrame`
          Default dataset to use for the plot. If not specified,
          must be supplied in each layer added to the plot.
      mapping : `FeatureSpec`
          Default list of aesthetic mappings to use for the plot.
          If not specified, must be supplied in each layer added to the plot.
  
      Returns
      -------
      `PlotSpec`
          Plot specification.
  
      Notes
      -----
      `ggplot()` initializes a ggplot object.
      It can be used to declare the input data frame for a graphic and
      to specify the set of plot aesthetics intended to be common
      throughout all subsequent layers unless specifically overridden.
  
      `ggplot()` is typically used to construct a plot incrementally,
      using the + operator to add layers to the existing ggplot object.
      This is advantageous in that the code is explicit about which layers
      are added and the order in which they are added. For complex graphics
      with multiple layers, initialization with `ggplot()` is recommended.
  
      There are three common ways to invoke ggplot (see examples below):
  
      - `ggplot(data, aes(x, y))`: This method is recommended if all layers use the same data and the same set of aesthetics, although this method can also be used to add a layer using data from another data frame.
      - `ggplot(data)`: This method specifies the default data frame to use for the plot, but no aesthetics are defined up front. This is useful when one data frame is used predominantly as layers are added, but the aesthetics may vary from one layer to another.
      - `ggplot()`: This method initializes a skeleton ggplot object which is fleshed out as layers are added. This method is useful when multiple data frames are used to produce different layers, as is often the case in complex graphics.
  
      `ggplot()` with no layers defined will produce an error message:
      "No layers in plot".
  
      Examples
      --------
      .. jupyter-execute::
          :linenos:
          :emphasize-lines: 11, 13, 15
  
          import numpy as np
          from lets_plot import *
          LetsPlot.setup_html()
          np.random.seed(42)
          n = 100
          x = np.random.uniform(-1, 1, size=n)
          y = np.random.normal(size=n)
          data = {'x': x, 'y': 25 * x ** 2 + y}
          # three ways to invoke ggplot, producing the same output:
          # (1)
          ggplot(data, aes(x='x', y='y')) + geom_point()
          # (2)
          ggplot(data) + geom_point(aes(x='x', y='y'))
          # (3)
          ggplot() + geom_point(aes(x='x', y='y'), data=data)
  
      """
      if isinstance(data, FeatureSpec):
          raise ValueError(
              "Object {!r} is not acceptable as 'data' argument in ggplot()".format(
                  data.kind
              )
          )
  
      if is_geocoder(data):
          data = data.get_geocodes()
  
      data, mapping, data_meta = as_annotated_data(data, mapping)
  
      plot_spec = PlotSpec(
          data, mapping, scales=[], layers=[], **data_meta
      )
  
      if has_global_value(PLOT_THEME):
          theme_options = json.loads(get_global_val(PLOT_THEME))
          theme_name = theme_options.pop("name", None)
          plot_spec += FeatureSpec("theme", theme_name, **theme_options)
  
      return plot_spec
  
file_path: lets-plot/python-package/lets_plot/plot/plot.py
imports: import json
  import numbers
  from lets_plot._global_settings import has_global_value, get_global_val, MAX_WIDTH, MAX_HEIGHT, PLOT_THEME
  from lets_plot.geo_data_internals.utils import is_geocoder
  from lets_plot.plot.core import FeatureSpec
  from lets_plot.plot.core import PlotSpec
  from lets_plot.plot.util import as_annotated_data
label_desc: Use image node_id 1 for calling a global function with example usage: ggplot(data, mapping) and returns: plot_spec