1

I have a 3D scatter plot of 3 variables x, y, z. I want to create bins in 2D space of x and y. Further i want to plot cdf for samples in each bin for z.

I have tried using hist2d in python but it gives counts for x and y variables.

mean = [0, 0]
cov = [[1, 1], [1, 2]]
x, y = np.random.multivariate_normal(mean, cov, 10000).T
plt.hist2d(x, y, bins=30, cmap='Blues')
cb = plt.colorbar()
cb.set_label('counts in bin')

I want to get distribution of z for each bin of x and y subspace

0 Answers0