# pandas 3.1.0 (BSD-3-Clause), harvested by tools/harvest_corpus.py
=== input

        Make a hexagonal binning plot.

        Generate a hexagonal binning plot of `x` versus `y`. If `C` is `None`
        (the default), this is a histogram of the number of occurrences
        of the observations at ``(x[i], y[i])``.

        If `C` is specified, specifies values at given coordinates
        ``(x[i], y[i])``. These values are accumulated for each hexagonal
        bin and then reduced according to `reduce_C_function`,
        having as default the NumPy's mean function (:meth:`numpy.mean`).
        (If `C` is specified, it must also be a 1-D sequence
        of the same length as `x` and `y`, or a column label.)

        Parameters
        ----------
        x : int or str
            The column label or position for x points.
        y : int or str
            The column label or position for y points.
        C : int or str, optional
            The column label or position for the value of `(x, y)` point.
        reduce_C_function : callable, default `np.mean`
            Function of one argument that reduces all the values in a bin to
            a single number (e.g. `np.mean`, `np.max`, `np.sum`, `np.std`).
        gridsize : int or tuple of (int, int), default 100
            The number of hexagons in the x-direction.
            The corresponding number of hexagons in the y-direction is
            chosen in a way that the hexagons are approximately regular.
            Alternatively, gridsize can be a tuple with two elements
            specifying the number of hexagons in the x-direction and the
            y-direction.
            The hexagons tile only the extent of the data, so for a fixed
            gridsize their apparent size varies with the range of the data
            and the axis limits. To control the area covered by the
            hexagons, pass matplotlib's ``extent`` keyword via ``**kwargs``.
        **kwargs
            Additional keyword arguments, such as ``ax``, ``figsize``,
            ``title`` and ``grid``, are documented in
            :meth:`DataFrame.plot`.

        Returns
        -------
        matplotlib.axes.Axes or numpy.ndarray of them
            A one-element ndarray is returned when ``subplots=True``.

        See Also
        --------
        DataFrame.plot : Make plots of a DataFrame.
        matplotlib.pyplot.hexbin : Hexagonal binning plot using matplotlib,
            the matplotlib function that is used under the hood.

        Examples
        --------
        The following examples are generated with random data from
        a normal distribution.

        .. plot::
            :context: close-figs

            >>> n = 10000
            >>> rng = np.random.default_rng(42)
            >>> df = pd.DataFrame(
            ...     {"x": rng.standard_normal(n), "y": rng.standard_normal(n)}
            ... )
            >>> ax = df.plot.hexbin(x="x", y="y", gridsize=20)

        The next example uses `C` and `np.sum` as `reduce_C_function`.
        Note that `'observations'` values ranges from 1 to 5 but the result
        plot shows values up to more than 25. This is because of the
        `reduce_C_function`.

        .. plot::
            :context: close-figs

            >>> n = 500
            >>> rng = np.random.default_rng(42)
            >>> df = pd.DataFrame(
            ...     {
            ...         "coord_x": rng.uniform(-3, 3, size=n),
            ...         "coord_y": rng.uniform(30, 50, size=n),
            ...         "observations": rng.integers(1, 5, size=n),
            ...     }
            ... )
            >>> ax = df.plot.hexbin(
            ...     x="coord_x",
            ...     y="coord_y",
            ...     C="observations",
            ...     reduce_C_function=np.sum,
            ...     gridsize=10,
            ...     cmap="viridis",
            ... )
        
=== parse numpydoc
short_description: 'Make a hexagonal binning plot.'
long_description: |
  Generate a hexagonal binning plot of `x` versus `y`. If `C` is `None`
  (the default), this is a histogram of the number of occurrences
  of the observations at ``(x[i], y[i])``.
  
  If `C` is specified, specifies values at given coordinates
  ``(x[i], y[i])``. These values are accumulated for each hexagonal
  bin and then reduced according to `reduce_C_function`,
  having as default the NumPy's mean function (:meth:`numpy.mean`).
  (If `C` is specified, it must also be a 1-D sequence
  of the same length as `x` and `y`, or a column label.)
blank_after_short_description: True
blank_after_long_description: True
style: numpydoc
- DocstringParam
  description: 'The column label or position for x points.'
  kind: param
  key: 'param'
  arg_name: 'x'
  type_name: 'int or str'
  is_optional: False
- DocstringParam
  description: 'The column label or position for y points.'
  kind: param
  key: 'param'
  arg_name: 'y'
  type_name: 'int or str'
  is_optional: False
- DocstringParam
  description: 'The column label or position for the value of `(x, y)` point.'
  kind: param
  key: 'param'
  arg_name: 'C'
  type_name: 'int or str'
  is_optional: True
  raw_type_name: 'int or str, optional'
- DocstringParam
  description: |
    Function of one argument that reduces all the values in a bin to
    a single number (e.g. `np.mean`, `np.max`, `np.sum`, `np.std`).
  kind: param
  key: 'param'
  arg_name: 'reduce_C_function'
  type_name: 'callable'
  is_optional: True
  default: 'np.mean'
  raw_type_name: 'callable, default `np.mean`'
- DocstringParam
  description: |
    The number of hexagons in the x-direction.
    The corresponding number of hexagons in the y-direction is
    chosen in a way that the hexagons are approximately regular.
    Alternatively, gridsize can be a tuple with two elements
    specifying the number of hexagons in the x-direction and the
    y-direction.
    The hexagons tile only the extent of the data, so for a fixed
    gridsize their apparent size varies with the range of the data
    and the axis limits. To control the area covered by the
    hexagons, pass matplotlib's ``extent`` keyword via ``**kwargs``.
  kind: param
  key: 'param'
  arg_name: 'gridsize'
  type_name: 'int or tuple of (int, int)'
  is_optional: True
  default: '100'
  raw_type_name: 'int or tuple of (int, int), default 100'
- DocstringParam
  description: |
    Additional keyword arguments, such as ``ax``, ``figsize``,
    ``title`` and ``grid``, are documented in
    :meth:`DataFrame.plot`.
  kind: param
  key: 'param'
  arg_name: '**kwargs'
  is_optional: False
- DocstringReturns
  description: 'A one-element ndarray is returned when ``subplots=True``.'
  kind: returns
  key: 'returns'
  type_name: 'matplotlib.axes.Axes or numpy.ndarray of them'
  is_generator: False
- DocstringMeta
  description: |
    DataFrame.plot : Make plots of a DataFrame.
    matplotlib.pyplot.hexbin : Hexagonal binning plot using matplotlib,
        the matplotlib function that is used under the hood.
  kind: text
  key: 'see_also'
  title: 'See Also'
- DocstringExample
  description: |
    The following examples are generated with random data from
    a normal distribution.
    
    .. plot::
        :context: close-figs
  kind: examples
  key: 'examples'
  snippet: '    >>> n = 10000'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '    >>> rng = np.random.default_rng(42)'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: |
        >>> df = pd.DataFrame(
        ...     {"x": rng.standard_normal(n), "y": rng.standard_normal(n)}
        ... )
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '    >>> ax = df.plot.hexbin(x="x", y="y", gridsize=20)'
- DocstringExample
  description: |
    The next example uses `C` and `np.sum` as `reduce_C_function`.
    Note that `'observations'` values ranges from 1 to 5 but the result
    plot shows values up to more than 25. This is because of the
    `reduce_C_function`.
    
    .. plot::
        :context: close-figs
  kind: examples
  key: 'examples'
  snippet: '    >>> n = 500'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '    >>> rng = np.random.default_rng(42)'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: |
        >>> df = pd.DataFrame(
        ...     {
        ...         "coord_x": rng.uniform(-3, 3, size=n),
        ...         "coord_y": rng.uniform(30, 50, size=n),
        ...         "observations": rng.integers(1, 5, size=n),
        ...     }
        ... )
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: |
        >>> ax = df.plot.hexbin(
        ...     x="coord_x",
        ...     y="coord_y",
        ...     C="observations",
        ...     reduce_C_function=np.sum,
        ...     gridsize=10,
        ...     cmap="viridis",
        ... )
=== detect
numpydoc
=== compose numpydoc
Make a hexagonal binning plot.

Generate a hexagonal binning plot of `x` versus `y`. If `C` is `None`
(the default), this is a histogram of the number of occurrences
of the observations at ``(x[i], y[i])``.

If `C` is specified, specifies values at given coordinates
``(x[i], y[i])``. These values are accumulated for each hexagonal
bin and then reduced according to `reduce_C_function`,
having as default the NumPy's mean function (:meth:`numpy.mean`).
(If `C` is specified, it must also be a 1-D sequence
of the same length as `x` and `y`, or a column label.)

Parameters
----------
x : int or str
    The column label or position for x points.
y : int or str
    The column label or position for y points.
C : int or str, optional
    The column label or position for the value of `(x, y)` point.
reduce_C_function : callable, default `np.mean`
    Function of one argument that reduces all the values in a bin to
    a single number (e.g. `np.mean`, `np.max`, `np.sum`, `np.std`).
gridsize : int or tuple of (int, int), default 100
    The number of hexagons in the x-direction.
    The corresponding number of hexagons in the y-direction is
    chosen in a way that the hexagons are approximately regular.
    Alternatively, gridsize can be a tuple with two elements
    specifying the number of hexagons in the x-direction and the
    y-direction.
    The hexagons tile only the extent of the data, so for a fixed
    gridsize their apparent size varies with the range of the data
    and the axis limits. To control the area covered by the
    hexagons, pass matplotlib's ``extent`` keyword via ``**kwargs``.
**kwargs
    Additional keyword arguments, such as ``ax``, ``figsize``,
    ``title`` and ``grid``, are documented in
    :meth:`DataFrame.plot`.

Returns
-------
matplotlib.axes.Axes or numpy.ndarray of them
    A one-element ndarray is returned when ``subplots=True``.

See Also
--------
DataFrame.plot : Make plots of a DataFrame.
matplotlib.pyplot.hexbin : Hexagonal binning plot using matplotlib,
    the matplotlib function that is used under the hood.

Examples
--------
The following examples are generated with random data from
a normal distribution.

.. plot::
    :context: close-figs

    >>> n = 10000
    >>> rng = np.random.default_rng(42)
    >>> df = pd.DataFrame(
    ...     {"x": rng.standard_normal(n), "y": rng.standard_normal(n)}
    ... )
    >>> ax = df.plot.hexbin(x="x", y="y", gridsize=20)

The next example uses `C` and `np.sum` as `reduce_C_function`.
Note that `'observations'` values ranges from 1 to 5 but the result
plot shows values up to more than 25. This is because of the
`reduce_C_function`.

.. plot::
    :context: close-figs

    >>> n = 500
    >>> rng = np.random.default_rng(42)
    >>> df = pd.DataFrame(
    ...     {
    ...         "coord_x": rng.uniform(-3, 3, size=n),
    ...         "coord_y": rng.uniform(30, 50, size=n),
    ...         "observations": rng.integers(1, 5, size=n),
    ...     }
    ... )
    >>> ax = df.plot.hexbin(
    ...     x="coord_x",
    ...     y="coord_y",
    ...     C="observations",
    ...     reduce_C_function=np.sum,
    ...     gridsize=10,
    ...     cmap="viridis",
    ... )
