HistogramLUTItem

class pyqtgraph.HistogramLUTItem(image=None, fillHistogram=True)[source]

This is a graphicsWidget which provides controls for adjusting the display of an image. Includes:

  • Image histogram
  • Movable region over histogram to select black/white levels
  • Gradient editor to define color lookup table for single-channel images
__init__(image=None, fillHistogram=True)[source]

If image (ImageItem) is provided, then the control will be automatically linked to the image and changes to the control will be immediately reflected in the image’s appearance. By default, the histogram is rendered with a fill. For performance, set fillHistogram = False.

autoHistogramRange()[source]

Enable auto-scaling on the histogram plot.

getLevels()[source]

Return the min and max levels.

getLookupTable(img=None, n=None, alpha=None)[source]

Return a lookup table from the color gradient defined by this HistogramLUTItem.

setHistogramRange(mn, mx, padding=0.1)[source]

Set the Y range on the histogram plot. This disables auto-scaling.

setImageItem(img)[source]

Set an ImageItem to have its levels and LUT automatically controlled by this HistogramLUTItem.

setLevels(mn, mx)[source]

Set the min and max levels.