RatioPlot

class RatioPlot.RatioPlot(numerator, denominator=0, **kwargs)[source]

Bases: MethodProxy.MethodProxy

Class for comparing 1-dimensional histograms.

Inherits from Histo1D which inherits from ROOT.TH1D, see official documentation as well!

Compares histograms to a baseline by computing the ratio for each bin.

The properties of the baseline (which is itself of type Histo1D) of the RatioPlot object can be accessed by prepending the prefix ‘baseline’ in front of the property name.

__init__(numerator, denominator=0, **kwargs)[source]

Initialize a ratio plot for 1-dimensional histograms.

Create an instance of RatioPlot with the specified (list of) numerator histogram(s) and denominator histogram.

Parameters:
  • numerator – numerator histogram or list thereof
  • denominator – denominator histogram which will act as the baseline
  • **kwargsRatioPlot properties
SetYMin(value)[source]

Set the minimal value of the y-axis.

Parameters:value (float) – minimal value of the y-axis
GetYMin()[source]

Return the minimal value of the y-axis.

Returntype:float
SetYMax(value)[source]

Set the maximal value of the y-axis.

Parameters:value (float) – maximal value of the y-axis
GetYMax()[source]

Return the maximal value of the y-axis.

Returntype:float
BuildFrame(**kwargs)[source]
SetName(name)[source]

Set the name of object.

Parameters:name (str) – name of the object
GetName()[source]

Return the name of the object.

Returntype:str
InheritsFrom(classname)[source]
SetDrawOption(option)[source]

Define the draw option for all numerator histograms.

Parameters:option (str) – draw option (see ROOT.THistPainter class reference)
GetDrawOption()[source]

Return the draw option defined for all numerator histograms.

Returntype:str
SetDrawArrows(boolean)[source]

Define whether the arrows should be drawn.

Parameters:boolean (bool) – if set to True arrows will be drawn whenever the ratio is outside the given y-axis range
GetDrawArrows()[source]

Return whether the arrows should be drawn.

Returntype:bool
SetDrawBenchmarkLines(boolean)[source]

Define whether the benchmark lines should be drawn.

Parameters:boolean (bool) – if set to True the benchmark lines will be drawn
GetDrawBenchmarklines()[source]

Return whether the benchmark lines should be drawn.

Returntype:bool