diff --git a/PyMca5/PyMcaGui/io/hdf5/Hdf5NodeView.py b/PyMca5/PyMcaGui/io/hdf5/Hdf5NodeView.py index 5f40497ad..d3913346c 100644 --- a/PyMca5/PyMcaGui/io/hdf5/Hdf5NodeView.py +++ b/PyMca5/PyMcaGui/io/hdf5/Hdf5NodeView.py @@ -110,6 +110,10 @@ def __init__(self, parent=None): method="getPlugin2DInstance", directoryList=PLUGINS_DIR) self._toolbar.addWidget(pluginsToolButton) + if hasattr(self, "getIntensityHistogramAction"): + self.getIntensityHistogramAction().setVisible(True) + else: + print("Plot2D getIntensityHistogramAction missing") class Plot2DViewWithPlugins(DataViews._Plot2dView): @@ -117,7 +121,6 @@ def createWidget(self, parent): widget = Plot2DWithPlugins(parent=parent) widget.setDefaultColormap(self.defaultColormap()) widget.getColormapAction().setColorDialog(self.defaultColorDialog()) - widget.getIntensityHistogramAction().setVisible(True) widget.setKeepDataAspectRatio(False) widget.getXAxis().setLabel('X') widget.getYAxis().setLabel('Y') diff --git a/PyMca5/PyMcaGui/plotting/SilxMaskImageWidget.py b/PyMca5/PyMcaGui/plotting/SilxMaskImageWidget.py index 7f1f66cee..a61a9d05e 100644 --- a/PyMca5/PyMcaGui/plotting/SilxMaskImageWidget.py +++ b/PyMca5/PyMcaGui/plotting/SilxMaskImageWidget.py @@ -579,6 +579,11 @@ def __init__(self, parent=None): PlotActions.ColormapAction(plot=self.plot, parent=self)) self.addAction(self.colormapAction) + self.pixelIntensitiesHistoAction = self.group.addAction( + PlotActions.PixelIntensitiesHistoAction(plot=self.plot, parent=self)) + self.addAction(self.pixelIntensitiesHistoAction) + self.pixelIntensitiesHistoAction.setVisible(True) + self.copyAction = self.group.addAction( PlotActions.CopyAction(plot=self.plot, parent=self)) self.addAction(self.copyAction) @@ -675,8 +680,8 @@ def _createToolBar(self, title, parent): index = objects.index(self.colormapAction) objects.insert(index + 1, self.keepDataAspectRatioButton) objects.insert(index + 2, self.yAxisInvertedButton) - objects.insert(index + 3, self.saveToolbutton) - objects.insert(index + 4, self.backgroundButton) + objects.insert(index + 4, self.saveToolbutton) + objects.insert(index + 5, self.backgroundButton) for obj in objects: if isinstance(obj, qt.QAction): toolbar.addAction(obj) diff --git a/PyMca5/PyMcaGui/pymca/PyMcaImageWindow.py b/PyMca5/PyMcaGui/pymca/PyMcaImageWindow.py index e0f43c89f..ee3c156d4 100644 --- a/PyMca5/PyMcaGui/pymca/PyMcaImageWindow.py +++ b/PyMca5/PyMcaGui/pymca/PyMcaImageWindow.py @@ -88,7 +88,7 @@ def _addImageClicked(self): self._connectCorrelator() if self._imageData is None: return - if self._imageData == []: + if len(self._imageData) == 0: return if not RGBImageCalculator.RGBImageCalculator._addImageClicked(self): diff --git a/PyMca5/PyMcaGui/pymca/RGBImageCalculator.py b/PyMca5/PyMcaGui/pymca/RGBImageCalculator.py index 6f315ad83..76cd538b4 100644 --- a/PyMca5/PyMcaGui/pymca/RGBImageCalculator.py +++ b/PyMca5/PyMcaGui/pymca/RGBImageCalculator.py @@ -331,7 +331,7 @@ def _addImageClicked(self): _logger.debug("Add image clicked") if self._imageData is None: return - if self._imageData == []: + if len(self._imageData) == 0: return text = "%s" % self.name.text() if not len(text):