Skip to content

Commit

Permalink
Use item with PlotWidget.setActive* methods
Browse files Browse the repository at this point in the history
  • Loading branch information
t20100 committed Dec 8, 2023
1 parent 41ca4e1 commit cf2631b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/plotCurveLegendWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _switchCurveActive(self, curve):
"""
plot = curve.getPlot()
plot.setActiveCurve(
curve.getName() if curve != plot.getActiveCurve() else None)
curve if curve != plot.getActiveCurve() else None)

def _switchCurveVisibility(self, curve):
"""Toggle the visibility of a curve
Expand Down
2 changes: 1 addition & 1 deletion src/silx/gui/plot/CompareImages.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def __init__(self, parent=None, backend=None):
if silx.config.DEFAULT_PLOT_IMAGE_Y_AXIS_ORIENTATION == 'downward':
self.__plot.getYAxis().setInverted(True)
self.__plot.addItem(self.__item)
self.__plot.setActiveImage("_virtual")
self.__plot.setActiveImage(self.__item)

self.__plot.setKeepDataAspectRatio(True)
self.__plot.sigPlotSignal.connect(self.__plotSlot)
Expand Down
2 changes: 1 addition & 1 deletion src/silx/gui/plot/ComplexImageView.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def __init__(self, parent=None):
self._plotImage.setName('__ComplexImageView__complex_image__')
self._plotImage.sigItemChanged.connect(self._itemChanged)
self._plot2D.addItem(self._plotImage)
self._plot2D.setActiveImage(self._plotImage.getName())
self._plot2D.setActiveImage(self._plotImage)

toolBar = qt.QToolBar('Complex', self)
toolBar.addWidget(
Expand Down
2 changes: 1 addition & 1 deletion src/silx/gui/plot/StackView.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ def setStack(self, stack, perspective=None, reset=True, calibrations=None):
if exists is None:
self._plot.addItem(self._stackItem)

self._plot.setActiveImage(self._stackItem.getName())
self._plot.setActiveImage(self._stackItem)
self.__updatePlotLabels()
self._updateTitle()

Expand Down

0 comments on commit cf2631b

Please sign in to comment.