fastplotlib.ui.ImguiColorbar#

class ImguiColorbar(graphics, histogram=None, data_range=None, title=None, height=None, bar_width=16, region_drag=True)[source]#

An imgui colorbar with draggable vmin/vmax handles, an optional histogram, a gamma slider, and a right-click colormap picker.

Parameters:
  • graphics (ImageGraphic | ImageVolumeGraphic | LineGraphic | ScatterGraphic | list) – the graphic(s) whose colormap and value range this colorbar controls. The bar drives vmin and vmax of an image, and cmap_range of a line or scatter, which must already have a cmap.

  • histogram (tuple[np.ndarray, np.ndarray], optional) – a precomputed (counts, edges) histogram drawn to the left of the bar. It is not recomputed when the graphic’s data changes, set the histogram property to update it.

  • data_range ((min, max), optional) – the value range spanned by the bar. Defaults to the histogram edges if a histogram is provided, otherwise to the data range of the first graphic.

  • title (str, optional) – title drawn above the bar, no title is drawn if None

  • height (int, optional) – height of the colorbar in pixels, fills the available vertical space if None

  • bar_width (int) – width of the colored bar in pixels

  • region_drag (bool) – if True, dragging between the handles shifts the vmin/vmax window without changing its width

Examples#

ImGUI Colorbar

ImGUI Colorbar

ImGUI Colorbar on Lines and Scatters

ImGUI Colorbar on Lines and Scatters

Volume movie

Volume movie

Volume modes

Volume modes