pygram11.var2d(x, y, xbins, ybins, weights=None, flow=False)[source]

Histogram the x, y data with variable width binning.

The two input arrays (x and y) must be the same length (shape).

  • x (numpy.ndarray) – First entries in data pairs to histogram.

  • y (numpy.ndarray) – Second entries in data pairs to histogram.

  • xbins (numpy.ndarray) – Bin edges for the x dimension.

  • ybins (np.ndarray) – Bin edges for the y dimension.

  • weights (array_like, optional) – The weights for data element. If weights are absent, the second return type will be None.

  • flow (bool) – Include under/overflow.

  • ValueError – If x and y have different shape.

  • ValueError – If either bin edge definition is not monotonically increasing.

  • TypeError – If x, y, or weights are unsupported types



A histogram of (x, y) where the edges are defined by a numpy.logspace() in both dimensions:

>>> bins = numpy.logspace(0.1, 1.0, 10, endpoint=True)
>>> h, __ = var2d(x, y, bins, bins)