--- UserCode/OSUT3Analysis/Configuration/scripts/makeComparisonPlots.py 2013/07/16 14:33:28 1.2 +++ UserCode/OSUT3Analysis/Configuration/scripts/makeComparisonPlots.py 2013/08/02 11:25:53 1.3 @@ -203,6 +203,7 @@ def ratioHistogram( dataHist, mcHist, re ratio.SetBinError(i+1,groupErr(g)) ratio.GetYaxis().SetTitle("#frac{hist1-hist2}{hist2}") + ratio.GetXaxis().SetLabelOffset(0.03) ratio.SetLineColor(1) ratio.SetMarkerColor(1) ratio.SetLineWidth(2) @@ -267,10 +268,11 @@ def MakeOneDHist(histogramName): Histogram.Rebin(RebinFactor) xAxisLabel = Histogram.GetXaxis().GetTitle() - unitIndex = xAxisLabel.find("[") - yAxisLabel = "" - if unitIndex is not -1: #x axis has a unit - yAxisLabel = "Entries / " + str(Histogram.GetXaxis().GetBinWidth(1)) + " " + xAxisLabel[unitIndex+1:-1] + unitBeginIndex = xAxisLabel.find("[") + unitEndIndex = xAxisLabel.find("]") + + if unitBeginIndex is not -1 and unitEndIndex is not -1: #x axis has a unit + yAxisLabel = "Entries / " + str(Histogram.GetXaxis().GetBinWidth(1)) + " " + xAxisLabel[unitBeginIndex+1:unitEndIndex] else: yAxisLabel = "Entries per bin (" + str(Histogram.GetXaxis().GetBinWidth(1)) + " width)" if arguments.normalizeToUnitArea: @@ -292,7 +294,7 @@ def MakeOneDHist(histogramName): Histogram.SetMarkerColor(colors[colorList[colorIndex]]) Histogram.SetLineColor(colors[colorList[colorIndex]]) colorIndex = colorIndex + 1 - if colorIndex is len(colorList)-1: + if colorIndex is len(colorList): colorIndex = 0 markerStyle = 20