class_docstr: Utility renderer using Matplotlib to render a grid of plots over the same (x, y) range.
  
  Args:
      nrows (int, optional): Number of rows of plots, default ``1``.
      ncols (int, optional): Number of columns of plots, default ``1``.
      figsize (tuple(float, float), optional): Figure size in inches, default ``(9, 9)``.
      show_frame (bool, optional): Whether to show frame and axes ticks, default ``True``.
      backend (str, optional): Matplotlib backend to use or ``None`` for default backend.
          Default ``None``.
      gridspec_kw (dict, optional): Gridspec keyword arguments to pass to ``plt.subplots``,
          default None.
docstr: Plot quad grid lines on a single Axes.
  
  Args:
      x (array-like of shape (ny, nx) or (nx,)): The x-coordinates of the grid points.
      y (array-like of shape (ny, nx) or (ny,)): The y-coordinates of the grid points.
      ax (int or Matplotlib Axes, optional): Which Axes to plot on, default ``0``.
      color (str, optional): Color to plot grid lines, default ``"black"``.
      alpha (float, optional): Opacity to plot lines with, default ``0.1``.
      point_color (str, optional): Color to plot grid points or ``None`` if grid points
          should not be plotted, default ``None``.
      quad_as_tri_alpha (float, optional): Opacity to plot ``quad_as_tri`` grid, default 0.
  
  Colors may be a string color or the letter ``"C"`` followed by an integer in the range
  ``"C0"`` to ``"C9"`` to use a color from the ``tab10`` colormap.
  
  Warning:
      ``quad_as_tri_alpha > 0`` plots all quads as though they are unmasked.
code: def grid(
      self,
      x: ArrayLike,
      y: ArrayLike,
      ax: Axes | int = 0,
      color: str = "black",
      alpha: float = 0.1,
      point_color: str | None = None,
      quad_as_tri_alpha: float = 0,
  ) -> None:
      """Plot quad grid lines on a single Axes.
  
      Args:
          x (array-like of shape (ny, nx) or (nx,)): The x-coordinates of the grid points.
          y (array-like of shape (ny, nx) or (ny,)): The y-coordinates of the grid points.
          ax (int or Matplotlib Axes, optional): Which Axes to plot on, default ``0``.
          color (str, optional): Color to plot grid lines, default ``"black"``.
          alpha (float, optional): Opacity to plot lines with, default ``0.1``.
          point_color (str, optional): Color to plot grid points or ``None`` if grid points
              should not be plotted, default ``None``.
          quad_as_tri_alpha (float, optional): Opacity to plot ``quad_as_tri`` grid, default 0.
  
      Colors may be a string color or the letter ``"C"`` followed by an integer in the range
      ``"C0"`` to ``"C9"`` to use a color from the ``tab10`` colormap.
  
      Warning:
          ``quad_as_tri_alpha > 0`` plots all quads as though they are unmasked.
      """
      ax = self._get_ax(ax)
      x, y = self._grid_as_2d(x, y)
      kwargs: dict[str, Any] = dict(color=color, alpha=alpha)
      ax.plot(x, y, x.T, y.T, **kwargs)
      if quad_as_tri_alpha > 0:
          # Assumes no quad mask.
          xmid = 0.25 * (
              x[:-1, :-1] + x[1:, :-1] + x[:-1, 1:] + x[1:, 1:]
          )
          ymid = 0.25 * (
              y[:-1, :-1] + y[1:, :-1] + y[:-1, 1:] + y[1:, 1:]
          )
          kwargs["alpha"] = quad_as_tri_alpha
          ax.plot(
              np.stack((x[:-1, :-1], xmid, x[1:, 1:])).reshape((3, -1)),
              np.stack((y[:-1, :-1], ymid, y[1:, 1:])).reshape((3, -1)),
              np.stack((x[1:, :-1], xmid, x[:-1, 1:])).reshape((3, -1)),
              np.stack((y[1:, :-1], ymid, y[:-1, 1:])).reshape((3, -1)),
              **kwargs,
          )
      if point_color is not None:
          ax.plot(
              x, y, color=point_color, alpha=alpha, marker="o", lw=0
          )
      ax._need_autoscale = True
  
imports: from __future__ import annotations
  from collections.abc import Sequence
  import io
  from typing import TYPE_CHECKING, Any, cast
  import matplotlib.collections
  import matplotlib.pyplot
  import numpy
  from contourpy import FillType, LineType
  from contourpy.convert import convert_filled, convert_lines
  from contourpy.enum_util import as_fill_type, as_line_type
  from contourpy.util.mpl_util import filled_to_mpl_paths, lines_to_mpl_paths
  from contourpy.util.renderer import Renderer
label_desc: Use image node_id 6 for calling the MplRenderer obj's underlying member method code with example usage: obj.grid(x, y, ax, color, alpha, point_color, quad_as_tri_alpha) without return types