iq_readout.utils.histogram_2d#

histogram_2d(z, n_bins=[100, 100], density=True)[source]#

Runs a 2d histogram and returns the counts, xx, and yy data flattened.

Parameters:
z: np.array(N, 2)

Points in the 2D space

n_bins:(nx_bins, ny_bins)

List of two elements corresponding to the number of bins for the first and second coordinate

density

If True, returns the probability density function values

Returns:
counts: np.array(nx_bins, ny_bins)

Counts or PDF

xx_centers: np.array(nx_bins, ny_bins)

Centers of the bins for the first coordinate

yy_centers: np.array(nx_bins, ny_bins)

Centers of the bins for the second coordinate