From aaf86b4f5cf341c7849f2bd226601f889c5ba891 Mon Sep 17 00:00:00 2001 From: Wenduo Zhou <zhouw@ornl.gov> Date: Fri, 7 Aug 2015 10:26:19 -0400 Subject: [PATCH] Refs #13136. Fixed a problem with line color and marker. --- .../HFIRPowderReduction/HfirPDReductionControl.py | 4 ++-- .../scripts/HFIRPowderReduction/HfirPDReductionGUI.py | 3 ++- .../scripts/HFIRPowderReduction/MplFigureCanvas.py | 10 ++++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Code/Mantid/scripts/HFIRPowderReduction/HfirPDReductionControl.py b/Code/Mantid/scripts/HFIRPowderReduction/HfirPDReductionControl.py index e94679b02ce..66472f471e5 100644 --- a/Code/Mantid/scripts/HFIRPowderReduction/HfirPDReductionControl.py +++ b/Code/Mantid/scripts/HFIRPowderReduction/HfirPDReductionControl.py @@ -683,7 +683,7 @@ class HFIRPDRedControl(object): def parseSpiceData(self, expno, scanno, detefftablews=None): - """ Load SPICE data to MDWorkspaces + """ Load SPICE data to MDWorkspaces from raw table workspace """ # Get reduction manager try: @@ -799,7 +799,7 @@ class HFIRPDRedControl(object): def reduceSpicePDData(self, exp, scan, unit, xmin, xmax, binsize, wavelength=None, excludeddetlist=None,scalefactor=None): - """ Reduce SPICE powder diffraction data. + """ Reduce SPICE powder diffraction data from MDEventWorkspaces Return - Boolean as reduction is successful or not """ # Get reduction manager diff --git a/Code/Mantid/scripts/HFIRPowderReduction/HfirPDReductionGUI.py b/Code/Mantid/scripts/HFIRPowderReduction/HfirPDReductionGUI.py index 83f96e4509e..706ae01a4a4 100644 --- a/Code/Mantid/scripts/HFIRPowderReduction/HfirPDReductionGUI.py +++ b/Code/Mantid/scripts/HFIRPowderReduction/HfirPDReductionGUI.py @@ -1369,8 +1369,9 @@ class MainWindow(QtGui.QMainWindow): xlabel = self._getXLabelFromUnit(unit) canvas = self.ui.graphicsView_mergeRun - canvas.clearAllLines() + # canvas.clearAllLines() NO NEED canvas.clearCanvas() + canvas.resetLineColorStyle() for scan in scanlist: r = self._uiReduceData(3, unit, expno, scan) diff --git a/Code/Mantid/scripts/HFIRPowderReduction/MplFigureCanvas.py b/Code/Mantid/scripts/HFIRPowderReduction/MplFigureCanvas.py index 74306b15bbf..793942df560 100644 --- a/Code/Mantid/scripts/HFIRPowderReduction/MplFigureCanvas.py +++ b/Code/Mantid/scripts/HFIRPowderReduction/MplFigureCanvas.py @@ -263,7 +263,9 @@ class Qt4MplCanvas(FigureCanvas): self._lineDict = {} self._lineIndex = 0 + # legend and color bar self.colorBar = None + # self._myLegend = None return @@ -444,6 +446,13 @@ class Qt4MplCanvas(FigureCanvas): # ENDIF(plot) # ENDFOR + # Remove legend + # only appied in new version of matplotlib + # if self._myLegend is not None: + # self._myLegend.remove() + + self._setupLegend() + self.draw() return @@ -636,6 +645,7 @@ class Qt4MplCanvas(FigureCanvas): location = 'best' handles, labels = self.axes.get_legend_handles_labels() + # self._myLegend = self.axes.legend(handles, labels, loc=location) # print handles # print labels -- GitLab