class_docstr: **Bases:** :class:`PlotItem <pyqtgraph.PlotItem>`
  
  :class:`ColorBarItem` controls the application of a 
  :ref:`color map <apiref_colormap>` to one (or more) 
  :class:`~pyqtgraph.ImageItem`. It is a simpler, compact alternative to 
  :class:`~pyqtgraph.HistogramLUTItem`, without histogram or the 
  option to adjust the colors of the look-up table.
  
  A labeled axis is displayed directly next to the gradient to help identify values.
  Handles included in the color bar allow for interactive adjustment.
  
  A ColorBarItem can be assigned one or more :class:`~pyqtgraph.ImageItem` s 
  that will be displayed according to the selected color map and levels. The
  ColorBarItem can be used as a separate element in a 
  :class:`~pyqtgraph.GraphicsLayout` or added to the layout of a 
  :class:`~pyqtgraph.PlotItem` used to display image data with coordinate axes.
  
  =============================  =============================================
  **Signals:**
  sigLevelsChanged(self)         Emitted when the range sliders are moved
  sigLevelsChangeFinished(self)  Emitted when the range sliders are released
  =============================  =============================================
class_docstr_tok: ["*","*","Bases",":","*","*",":","class",":","`","PlotItem","<","pyqtgraph.PlotItem",">","`",":","class",":","`","ColorBarItem","`","controls","the","application","of","a",":","ref",":","`","color","map","<","apiref_colormap",">","`","to","one","(","or","more",")",":","class",":","`","~pyqtgraph.ImageItem","`",".","It","is","a","simpler",",","compact","alternative","to",":","class",":","`","~pyqtgraph.HistogramLUTItem","`",",","without","histogram","or","the","option","to","adjust","the","colors","of","the","look-up","table",".","A","labeled","axis","is","displayed","directly","next","to","the","gradient","to","help","identify","values",".","Handles","included","in","the","color","bar","allow","for","interactive","adjustment",".","A","ColorBarItem","can","be","assigned","one","or","more",":","class",":","`","~pyqtgraph.ImageItem","`","s","that","will","be","displayed","according","to","the","selected","color","map","and","levels",".","The","ColorBarItem","can","be","used","as","a","separate","element","in","a",":","class",":","`","~pyqtgraph.GraphicsLayout","`","or","added","to","the","layout","of","a",":","class",":","`","~pyqtgraph.PlotItem","`","used","to","display","image","data","with","coordinate","axes",".","=============================","=============================================","*","*","Signals",":","*","*","sigLevelsChanged","(","self",")","Emitted","when","the","range","sliders","are","moved","sigLevelsChangeFinished","(","self",")","Emitted","when","the","range","sliders","are","released","=============================","============================================="]
docstr: Sets a color map to determine the ColorBarItem's look-up table. The same
  look-up table is applied to any assigned ImageItem.
  
  `colorMap` can be a :class:`~pyqtgraph.ColorMap` or a string argument that is passed to 
  :func:`colormap.get() <pyqtgraph.colormap.get>`.
docstr_tok: ["Sets","a","color","map","to","determine","the","ColorBarItem","'s","look-up","table",".","The","same","look-up","table","is","applied","to","any","assigned","ImageItem",".","`","colorMap","`","can","be","a",":","class",":","`","~pyqtgraph.ColorMap","`","or","a","string","argument","that","is","passed","to",":","func",":","`","colormap.get","(",")","<","pyqtgraph.colormap.get",">","`","."]
code: def setColorMap(self, colorMap):
      """
      Sets a color map to determine the ColorBarItem's look-up table. The same
      look-up table is applied to any assigned ImageItem.
  
      `colorMap` can be a :class:`~pyqtgraph.ColorMap` or a string argument that is passed to
      :func:`colormap.get() <pyqtgraph.colormap.get>`.
      """
      if isinstance(colorMap, str):
          colorMap = colormap.get(colorMap)
      self._colorMap = colorMap
      self._update_items(update_cmap=True)
  
file_path: pyqtgraph/pyqtgraph/graphicsItems/ColorBarItem.py
imports: import math
  import weakref
  import numpy
  from ..None import colormap
  from ..None import functions
  from ..Qt import QtCore, QtGui, QtWidgets
  from .LinearRegionItem import LinearRegionItem
  from .PlotItem import PlotItem
label_desc: Use image node_id 3 for calling the ColorBarItem obj's underlying member method code with example usage: obj.setColorMap(colorMap) without return types