adbin_hist2d_rectangles

hep_spt.adbin_hist2d_rectangles(bins, smp, range=None, weights=None, cmap=None, fill='sw', color=True, **kwargs)[source]

Create a list of rectangles from a list of bins. It uses the input data in “arr” to calculate the associated quantity, which is specified in “fill”.

Parameters
  • bins (list(AdBin)) – input bins.

  • smp (numpy.ndarray) – input sample. It must have shape (n, 2).

  • range (None or tuple(np.ndarray, np.ndarray)) – range of the histogram in each dimension. As [(xmin, ymin), (xmax, ymax)].

  • weights (list(value-type)) – input weights.

  • cmap (matplotlib.colors.Colormap) – optional color map. If “None”, the default from matplotlib.pyplot is used.

  • fill (str) – method to use for filling (‘sw’ or ‘dens’).

  • color (bool) – whether the output rectangles are filled with a color or not.

  • kwargs (dict) – any other argument to the constructor of matplotlib.patches.Rectangle.

Returns

Rectangles and contents.

Return type

numpy.ndarray, numpy.ndarray