class_docstr: Legend guide
  
  Parameters
  ----------
  nrow : int, default=None
      Number of rows of legends.
  ncol : int, default=None
      Number of columns of legends.
  byrow : bool, default=False
      Whether to fill the legend row-wise or column-wise.
  keywidth : float, default=None
      Width of the legend key.
  keyheight : float, default=None
      Height of the legend key.
  kwargs : dict
      Parameters passed on to [](`~plotnine.guides.guide`).
docstr: Make information needed to draw a legend for each of the layers.
  
  For each layer, that information is a dictionary with the geom
  to draw the guide together with the data and the parameters that
  will be used in the call to geom.
docstr_tok: ["Make","information","needed","to","draw","a","legend","for","each","of","the","layers",".","For","each","layer",",","that","information","is","a","dictionary","with","the","geom","to","draw","the","guide","together","with","the","data","and","the","parameters","that","will","be","used","in","the","call","to","geom","."]
code: def create_geoms(self, plot):
      """
      Make information needed to draw a legend for each of the layers.
  
      For each layer, that information is a dictionary with the geom
      to draw the guide together with the data and the parameters that
      will be used in the call to geom.
      """
      # A layer either contributes to the guide, or it does not. The
      # guide entries may be ploted in the layers
      self.glayers = []
      for l in plot.layers:
          exclude = set()
          if isinstance(l.show_legend, dict):
              l.show_legend = rename_aesthetics(l.show_legend)
              exclude = {
                  ae for ae, val in l.show_legend.items() if not val
              }
          elif l.show_legend not in (None, True):
              continue
  
          matched = self.legend_aesthetics(l, plot)
  
          # This layer does not contribute to the legend
          if not set(matched) - exclude:
              continue
  
          data = self.key[matched].copy()
  
          # Modify aesthetics
          try:
              data = l.use_defaults(data)
          except PlotnineError:
              warn(
                  "Failed to apply `after_scale` modifications "
                  "to the legend.",
                  PlotnineWarning,
              )
              data = l.use_defaults(data, aes_modifiers={})
  
          # override.aes in guide_legend manually changes the geom
          for ae in set(self.override_aes) & set(data.columns):
              data[ae] = self.override_aes[ae]
  
          data = remove_missing(
              data,
              l.geom.params["na_rm"],
              list(l.geom.REQUIRED_AES | l.geom.NON_MISSING_AES),
              f"{l.geom.__class__.__name__} legend",
          )
          self.glayers.append(
              types.SimpleNamespace(geom=l.geom, data=data, layer=l)
          )
      if not self.glayers:
          return None
      return self
  
imports: from __future__ import annotations
  import hashlib
  import types
  import typing
  from contextlib import suppress
  from itertools import islice
  from warnings import warn
  import numpy
  import pandas
  from .._utils import SIZE_FACTOR, remove_missing
  from ..exceptions import PlotnineError, PlotnineWarning
  from ..geoms import geom_text
  from ..mapping.aes import rename_aesthetics
  from .guide import guide
label_desc: Use image node_id 3 for calling the guide_legend obj's underlying member method code with example usage: obj.create_geoms(plot) and returns: self, None