Profile: Toolbars with profile tools

Utility functions, toolbars and actions to create profile on images and stacks of images

ProfileToolBar class

class ProfileToolBar(parent=None, plot=None, profileWindow=None, title=None)[source]

Bases: PyQt5.QtWidgets.QToolBar

QToolBar providing profile tools operating on a PlotWindow.


  • plot: Associated PlotWindow on which the profile line is drawn.
  • actionGroup: QActionGroup of available actions.

To run the following sample code, a QApplication must be initialized. First, create a PlotWindow and add a ProfileToolBar.

>>> from silx.gui.plot import PlotWindow
>>> from silx.gui.plot.Profile import ProfileToolBar
>>> plot = PlotWindow()  # Create a PlotWindow
>>> toolBar = ProfileToolBar(plot=plot)  # Create a profile toolbar
>>> plot.addToolBar(toolBar)  # Add it to plot
>>>  # To display the PlotWindow with the profile toolbar
  • plotPlotWindow instance on which to operate.
  • profileWindow – Plot widget instance where to display the profile curve or None to create one.
  • title (str) – See QToolBar.
  • parent – See QToolBar.

The PlotWidget associated to the toolbar.


Return the manager of the profiles.

Return type:ProfileManager

Return plot widget in which the profile curve or the profile image is plotted.


Return window containing the profile curve widget.

This can return None if no profile was computed.


This method does nothing anymore. But could be implemented if needed.

It was used to set color to use for the ROI.

If set to None (the default), the overlay color is adapted to the active image colormap and changes if the active image colormap changes.


Remove profile curve and profile area.


This method does nothing anymore. But could be implemented if needed.

It was used to update the displayed profile and profile ROI.

This uses the current active image of the plot and the current ROI.


Hide profile window.

Profile3DToolBar class

class Profile3DToolBar(parent=None, stackview=None, title=None)[source]

Bases: silx.gui.plot.Profile.ProfileToolBar

stackView = None

StackView instance