plotratio
- coffea.hist.plotratio(num, denom, ax=None, clear=True, overflow='none', xerr=False, error_opts=None, denom_fill_opts=None, guide_opts=None, unc='clopper-pearson', label=None)[source]
Create a ratio plot, dividing two compatible histograms
- Parameters:
num (Hist) – Numerator, a single-axis histogram
denom (Hist) – Denominator, a single-axis histogram
ax (matplotlib.axes.Axes, optional) – Axes object (if None, one is created)
clear (bool, optional) – Whether to clear Axes before drawing (if passed); if False, this function will skip drawing the legend
overflow (str, optional) – If overflow behavior is not ‘none’, extra bins will be drawn on either end of the nominal axis range, to represent the contents of the overflow bins. See
Hist.sum
documentation for a description of the options.xerr (bool, optional) – If true, then error bars are drawn for x-axis to indicate the size of the bin.
error_opts (dict, optional) – A dictionary of options to pass to the matplotlib ax.errorbar call internal to this function. Leave blank for defaults. Some special options are interpreted by this function and not passed to matplotlib: ‘emarker’ (default: ‘’) specifies the marker type to place at cap of the errorbar.
denom_fill_opts (dict, optional) – A dictionary of options to pass to the matplotlib ax.fill_between call internal to this function, filling the denominator uncertainty band. Leave blank for defaults.
guide_opts (dict, optional) – A dictionary of options to pass to the matplotlib ax.axhline call internal to this function, to plot a horizontal guide line at ratio of 1. Leave blank for defaults.
unc (str, optional) – Uncertainty calculation option: ‘clopper-pearson’ interval for efficiencies; ‘poisson-ratio’ interval for ratio of poisson distributions; ‘num’ poisson interval of numerator scaled by denominator value (common for data/mc, for better or worse).
label (str, optional) – Associate a label to this entry (note: y axis label set by
num.label
)
- Returns:
ax – A matplotlib Axes object
- Return type:
matplotlib.axes.Axes