rootpy.plotting.root2matplotlib.errorbar

rootpy.plotting.root2matplotlib.errorbar(hists, xerr=True, yerr=True, xpadding=0, ypadding=0.1, xerror_in_padding=True, yerror_in_padding=True, emptybins=True, snap=True, axes=None, **kwargs)[source]

Make a matplotlib errorbar plot from a ROOT histogram or graph or list of histograms and graphs.

Parameters:

hists : Hist, Graph or list of Hist and Graph

The histogram(s) and/or Graph(s) to be plotted

xerr : bool, optional (default=True)

If True, x error bars will be displayed.

yerr : bool or string, optional (default=True)

If False, no y errors are displayed. If True, an individual y error will be displayed for each hist in the stack. If ‘linear’ or ‘quadratic’, a single error bar will be displayed with either the linear or quadratic sum of the individual errors.

xpadding : float or 2-tuple of floats, optional (default=0)

Padding to add on the left and right sides of the plot as a fraction of the axes width after the padding has been added. Specify unique left and right padding with a 2-tuple.

ypadding : float or 2-tuple of floats, optional (default=.1)

Padding to add on the top and bottom of the plot as a fraction of the axes height after the padding has been added. Specify unique top and bottom padding with a 2-tuple.

xerror_in_padding : bool, optional (default=True)

If True then make the padding inclusive of the x errors otherwise only pad around the x values.

yerror_in_padding : bool, optional (default=True)

If True then make the padding inclusive of the y errors otherwise only pad around the y values.

emptybins : bool, optional (default=True)

If True (the default) then plot bins with zero content otherwise only show bins with nonzero content.

snap : bool, optional (default=True)

If True (the default) then the origin is an implicit lower bound of the histogram unless the histogram has both positive and negative bins.

axes : matplotlib Axes instance, optional (default=None)

The axes to plot on. If None then use the global current axes.

kwargs : additional keyword arguments, optional

All additional keyword arguments are passed to matplotlib’s errorbar function.

Returns:

The return value from matplotlib’s errorbar function, or list of such

return values if a list of histograms and/or graphs was plotted.