plot1d

coffea.hist.plot1d(hist, ax=None, clear=True, overlay=None, stack=False, overflow='none', line_opts=None, fill_opts=None, error_opts=None, legend_opts={}, overlay_overflow='none', density=False, binwnorm=None, order=None)[source]

Create a 1D plot from a 1D or 2D Hist object

Parameters:
  • hist (Hist) – Histogram with maximum of two dimensions

  • 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

  • overlay (str, optional) – In the case that hist is 2D, specify the axis of hist to overlay (remaining axis will be x axis)

  • stack (bool, optional) – Whether to stack or overlay non-axis dimension (if it exists)

  • order (list, optional) – How to order when stacking. Take a list of identifiers.

  • 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.

  • line_opts (dict, optional) – A dictionary of options to pass to the matplotlib ax.step call internal to this function. Leave blank for defaults.

  • fill_opts (dict, optional) – A dictionary of options to pass to the matplotlib ax.fill_between call internal to this function. Leave blank for defaults.

  • 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.

  • legend_opts (dict, optional) – A dictionary of options to pass to the matplotlib ax.legend call internal to this fuction. Leave blank for defaults.

  • overlay_overflow (str, optional) – If overflow behavior is not ‘none’, extra bins in the overlay axis will be overlayed or stacked, to represent the contents of the overflow bins. See Hist.sum documentation for a description of the options.

  • density (bool, optional) – If true, convert sum weights to probability density (i.e. integrates to 1 over domain of axis) (Note: this option conflicts with binwnorm)

  • binwnorm (float, optional) – If true, convert sum weights to bin-width-normalized, with unit equal to supplied value (usually you want to specify 1.)

Returns:

ax – A matplotlib Axes object

Return type:

matplotlib.axes.Axes