Skip to main content
`Ctrl`+`K`

# `silx.gui.plot.actions.histogram`

`silx.gui.plot.actions.histogram` provides actions relative to histograms for `PlotWidget`.

The following QAction are available:

- `PixelIntensitiesHistoAction`

class HistogramWidget(*args, **kwargs)

  Widget displaying a histogram and some statistic indicators

  getPlotWidget()

    Returns `PlotWidget` use to display the histogram

  resetZoom()

    Reset PlotWidget zoom

  reset()

    Clear displayed information

  getItem()

    Returns item used to display histogram and statistics.

    Return type:

      `Item` | `None`

  setItem(item)

    Set item from which to display histogram and statistics.

    Parameters:

      item (`Item` | `None`)

  setHistogram(histogram, edges)

    Set displayed histogram

    Parameters:

      - histogram – Bin values (N)

      - edges – Bin edges (N+1)

  getHistogram(copy=True)

    Returns currently displayed histogram.

    Parameters:

      copy (`bool`) – True to get a copy, False to get internal representation (Do not modify!)

    Returns:

      (histogram, edges) or None

  setStatistics(min_=None, max_=None, mean=None, std=None, sum_=None)

    Set displayed statistic indicators.

    Parameters:

      - min_ (`float` | `None`)

      - max_ (`float` | `None`)

      - mean (`float` | `None`)

      - std (`float` | `None`)

      - sum_ (`float` | `None`)

class PixelIntensitiesHistoAction(plot, parent=None)

  QAction to plot the pixels intensities diagram

  Parameters:

    - plot – `PlotWidget` instance on which to operate

    - parent – See `QAction`

  getHistogramWidget()

    Returns the widget displaying the histogram

  getHistogram()

    Return the last computed histogram

    Return type:

      `ndarray` | `None`

    Returns:

      the histogram displayed in the HistogramWidget