code: def plot_series(
      s,
      cmap=None,
      color=None,
      ax=None,
      figsize=None,
      aspect="auto",
      **style_kwds,
  ):
      """
      Plot a GeoSeries.
  
      Generate a plot of a GeoSeries geometry with matplotlib.
  
      Parameters
      ----------
      s : Series
          The GeoSeries to be plotted. Currently Polygon,
          MultiPolygon, LineString, MultiLineString, Point and MultiPoint
          geometries can be plotted.
      cmap : str (default None)
          The name of a colormap recognized by matplotlib. Any
          colormap will work, but categorical colormaps are
          generally recommended. Examples of useful discrete
          colormaps include:
  
              tab10, tab20, Accent, Dark2, Paired, Pastel1, Set1, Set2
  
      color : str, np.array, pd.Series, List (default None)
          If specified, all objects will be colored uniformly.
      ax : matplotlib.pyplot.Artist (default None)
          axes on which to draw the plot
      figsize : pair of floats (default None)
          Size of the resulting matplotlib.figure.Figure. If the argument
          ax is given explicitly, figsize is ignored.
      aspect : 'auto', 'equal', None or float (default 'auto')
          Set aspect of axis. If 'auto', the default aspect for map plots is 'equal'; if
          however data are not projected (coordinates are long/lat), the aspect is by
          default set to 1/cos(s_y * pi/180) with s_y the y coordinate of the middle of
          the GeoSeries (the mean of the y range of bounding box) so that a long/lat
          square appears square in the middle of the plot. This implies an
          Equirectangular projection. If None, the aspect of `ax` won't be changed. It can
          also be set manually (float) as the ratio of y-unit to x-unit.
      **style_kwds : dict
          Color options to be passed on to the actual plot function, such
          as ``edgecolor``, ``facecolor``, ``linewidth``, ``markersize``,
          ``alpha``.
  
      Returns
      -------
      ax : matplotlib axes instance
      """
      if "colormap" in style_kwds:
          warnings.warn(
              "'colormap' is deprecated, please use 'cmap' instead "
              "(for consistency with matplotlib)",
              FutureWarning,
              stacklevel=3,
          )
          cmap = style_kwds.pop("colormap")
      if "axes" in style_kwds:
          warnings.warn(
              "'axes' is deprecated, please use 'ax' instead "
              "(for consistency with pandas)",
              FutureWarning,
              stacklevel=3,
          )
          ax = style_kwds.pop("axes")
  
      try:
          import matplotlib.pyplot as plt
      except ImportError:
          raise ImportError(
              "The matplotlib package is required for plotting in geopandas. "
              "You can install it using 'conda install -c conda-forge matplotlib' or "
              "'pip install matplotlib'."
          )
  
      if ax is None:
          fig, ax = plt.subplots(figsize=figsize)
  
      if aspect == "auto":
          if s.crs and s.crs.is_geographic:
              bounds = s.total_bounds
              y_coord = np.mean([bounds[1], bounds[3]])
              ax.set_aspect(1 / np.cos(y_coord * np.pi / 180))
              # formula ported from R package sp
              # https://github.com/edzer/sp/blob/master/R/mapasp.R
          else:
              ax.set_aspect("equal")
      elif aspect is not None:
          ax.set_aspect(aspect)
  
      if s.empty:
          warnings.warn(
              "The GeoSeries you are attempting to plot is "
              "empty. Nothing has been displayed.",
              UserWarning,
              stacklevel=3,
          )
          return ax
  
      if s.is_empty.all():
          warnings.warn(
              "The GeoSeries you are attempting to plot is "
              "composed of empty geometries. Nothing has been displayed.",
              UserWarning,
              stacklevel=3,
          )
          return ax
  
      # have colors been given for all geometries?
      color_given = pd.api.types.is_list_like(color) and len(
          color
      ) == len(s)
  
      # if cmap is specified, create range of colors based on cmap
      values = None
      if cmap is not None:
          values = np.arange(len(s))
          if hasattr(cmap, "N"):
              values = values % cmap.N
          style_kwds["vmin"] = style_kwds.get("vmin", values.min())
          style_kwds["vmax"] = style_kwds.get("vmax", values.max())
  
      # decompose GeometryCollections
      geoms, multiindex = _sanitize_geoms(s.geometry, prefix="Geom")
      values = np.take(values, multiindex, axis=0) if cmap else None
      # ensure indexes are consistent
      if color_given and isinstance(color, pd.Series):
          color = color.reindex(s.index)
      expl_color = (
          np.take(color, multiindex, axis=0) if color_given else color
      )
      expl_series = geopandas.GeoSeries(geoms)
  
      geom_types = expl_series.geom_type
      poly_idx = np.asarray(
          (geom_types == "Polygon") | (geom_types == "MultiPolygon")
      )
      line_idx = np.asarray(
          (geom_types == "LineString")
          | (geom_types == "MultiLineString")
          | (geom_types == "LinearRing")
      )
      point_idx = np.asarray(
          (geom_types == "Point") | (geom_types == "MultiPoint")
      )
  
      # plot all Polygons and all MultiPolygon components in the same collection
      polys = expl_series[poly_idx]
      if not polys.empty:
          # color overrides both face and edgecolor. As we want people to be
          # able to use edgecolor as well, pass color to facecolor
          facecolor = style_kwds.pop("facecolor", None)
          color_ = expl_color[poly_idx] if color_given else color
          if color is not None:
              facecolor = color_
  
          values_ = values[poly_idx] if cmap else None
          _plot_polygon_collection(
              ax,
              polys,
              values_,
              facecolor=facecolor,
              cmap=cmap,
              **style_kwds,
          )
  
      # plot all LineStrings and MultiLineString components in same collection
      lines = expl_series[line_idx]
      if not lines.empty:
          values_ = values[line_idx] if cmap else None
          color_ = expl_color[line_idx] if color_given else color
  
          _plot_linestring_collection(
              ax, lines, values_, color=color_, cmap=cmap, **style_kwds
          )
  
      # plot all Points in the same collection
      points = expl_series[point_idx]
      if not points.empty:
          values_ = values[point_idx] if cmap else None
          color_ = expl_color[point_idx] if color_given else color
  
          _plot_point_collection(
              ax, points, values_, color=color_, cmap=cmap, **style_kwds
          )
  
      ax.figure.canvas.draw_idle()
      return ax
  
imports: import warnings
  import numpy
  import pandas
  from pandas.plotting import PlotAccessor
  from pandas import CategoricalDtype
  import geopandas
  from packaging.version import Version
  from ._decorator import doc
label_desc: Use image node_id 8 for calling a global function with example usage: plot_series(s, cmap, color, ax, figsize, aspect) and returns: ax, ax, ax