class_docstr: Guides for each scale
  
  Used to assign a particular guide to an aesthetic(s).
  
  Parameters
  ----------
  kwargs : dict
      aesthetic - guide pairings. e.g
      ```python
      guides(color=guide_colorbar())
      ```
class_docstr_tok: ["Guides","for","each","scale","Used","to","assign","a","particular","guide","to","an","aesthetic","(","s",")",".","Parameters","--","--","--","--","--","kwargs",":","dict","aesthetic","-","guide","pairings",".","e.g","``","`","python","guides","(","color=guide_colorbar","(",")",")","``","`"]
docstr: Merge overlapped guides
  
  For example:
  
  ```python
   from plotnine import *
   p = (
      ggplot(mtcars, aes(y="wt", x="mpg", colour="factor(cyl)"))
      + stat_smooth(aes(fill="factor(cyl)"), method="lm")
      + geom_point()
   )
  ```
  
  would create two guides with the same hash
docstr_tok: ["Merge","overlapped","guides","For","example",":","``","`","python","from","plotnine","import","*","p","=","(","ggplot","(","mtcars",",","aes","(","y=","''","wt","''",",","x=","''","mpg","''",",","colour=","''","factor","(","cyl",")","''",")",")","+","stat_smooth","(","aes","(","fill=","''","factor","(","cyl",")","''",")",",","method=","''","lm","''",")","+","geom_point","(",")",")","``","`","would","create","two","guides","with","the","same","hash"]
code: def merge(self, gdefs):
      """
      Merge overlapped guides
  
      For example:
  
      ```python
       from plotnine import *
       p = (
          ggplot(mtcars, aes(y="wt", x="mpg", colour="factor(cyl)"))
          + stat_smooth(aes(fill="factor(cyl)"), method="lm")
          + geom_point()
       )
      ```
  
      would create two guides with the same hash
      """
      # group guide definitions by hash, and
      # reduce each group to a single guide
      # using the guide.merge method
      definitions = pd.DataFrame(
          {"gdef": gdefs, "hash": [g.hash for g in gdefs]}
      )
      grouped = definitions.groupby("hash", sort=False)
      gdefs = []
      for name, group in grouped:
          # merge
          gdef = group["gdef"].iloc[0]
          for g in group["gdef"].iloc[1:]:
              gdef = gdef.merge(g)
          gdefs.append(gdef)
      return gdefs
  
imports: from __future__ import annotations
  import typing
  from copy import deepcopy
  from warnings import warn
  import numpy
  import pandas
  from .._utils.registry import Registry
  from ..exceptions import PlotnineError, PlotnineWarning
  from .guide import guide
label_desc: Use image node_id 6 for calling the guides obj's underlying member method code with example usage: obj.merge(gdefs) and returns: gdefs