class_docstr: Guide colorbar
  
  Parameters
  ----------
  barwidth : float, default=None
      Width (in pixels) of the colorbar. If `None`, the
      [](`~plotnine.themes.themeable.legend_key_width`) is
      used. The value is multiplied by `1.45`.
  barheight : float, default=None
      Height (in pixels) of the colorbar.
      [](`~plotnine.themes.themeable.legend_key_height`) is
      used. The value is multiplied by `5 * 1.45`.
  nbin : int, default=20
      Number of bins for drawing a colorbar. A larger value yields
      a smoother colorbar
  raster : bool, default=False
      Whether to render the colorbar as a raster object.
  ticks : bool, default=True
      Whether tick marks on colorbar should be visible.
  draw_ulim : bool, default=True
      Whether to show the upper limit tick marks.
  draw_llim : bool, default=True
      Whether to show the lower limit tick marks.
  direction : Literal["horizontal", "vertical"], default="horizontal"
      Direction of the guide.
  kwargs : dict
      Parameters passed on to :class:`.guide`
class_docstr_tok: ["Guide","colorbar","Parameters","--","--","--","--","--","barwidth",":","float",",","default=None","Width","(","in","pixels",")","of","the","colorbar",".","If","`","None","`",",","the","[","]","(","`","~plotnine.themes.themeable.legend_key_width","`",")","is","used",".","The","value","is","multiplied","by","`","1.45","`",".","barheight",":","float",",","default=None","Height","(","in","pixels",")","of","the","colorbar",".","[","]","(","`","~plotnine.themes.themeable.legend_key_height","`",")","is","used",".","The","value","is","multiplied","by","`","5","*","1.45","`",".","nbin",":","int",",","default=20","Number","of","bins","for","drawing","a","colorbar",".","A","larger","value","yields","a","smoother","colorbar","raster",":","bool",",","default=False","Whether","to","render","the","colorbar","as","a","raster","object",".","ticks",":","bool",",","default=True","Whether","tick","marks","on","colorbar","should","be","visible",".","draw_ulim",":","bool",",","default=True","Whether","to","show","the","upper","limit","tick","marks",".","draw_llim",":","bool",",","default=True","Whether","to","show","the","lower","limit","tick","marks",".","direction",":","Literal","[","``","horizontal","''",",","``","vertical","''","]",",","default=","''","horizontal","''","Direction","of","the","guide",".","kwargs",":","dict","Parameters","passed","on","to",":","class",":","`",".guide","`"]
docstr: Return self if colorbar will be drawn and None if not
  
  This guide is not geom based
docstr_tok: ["Return","self","if","colorbar","will","be","drawn","and","None","if","not","This","guide","is","not","geom","based"]
code: def create_geoms(self, plot):
      """
      Return self if colorbar will be drawn and None if not
  
      This guide is not geom based
      """
      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)
  
          # layer uses guide
          if set(matched) - exclude:
              break
      # no break, no layer uses this guide
      else:
          return None
  
      return self
  
imports: from __future__ import annotations
  import hashlib
  import typing
  from warnings import warn
  import numpy
  import pandas
  from mizani.bounds import rescale
  from ..exceptions import PlotnineWarning
  from ..mapping.aes import rename_aesthetics
  from ..scales.scale_continuous import scale_continuous
  from .guide import guide
label_desc: Use image node_id 3 for calling the guide_colorbar obj's underlying member method code with example usage: obj.create_geoms(plot) and returns: self, None