I've generated a 2D Guassian distribution with matplotlib.pyplot.hist2d. What I'd like to know is if there is any function in Python that allows me to caluclate and plot the integral and derivative of a 2D histogram. Checking on internet I've found a lot of topics about this, but only for 1D distribution.
Could anyone help me?
This is my code:
import numpy as np
import matplotlib.pyplot as plt
#GENERATE 2 RANDOM GAUSSIAN DISTRIBUTION
mu1, sigma1 = 0, 0.1
s1 = np.random.normal(mu1, sigma1, 10000)
mu2, sigma2 = 0, 0.3
s2 = np.random.normal(mu2, sigma2, 10000)
#PLOT 2 RANDOM GAUSSIAN DISTRIBUTION
plt.figure(1)
plt.title('Histogram of a 2D-Gaussian Distribution')
plt.xlabel('Radial position')
plt.ylabel('Particle frequency')
bins1 = plt.hist(s1, 100)
bins2 = plt.hist(s2, 100)
plt.show()
#GENERATE AND PLOT 2D RANDOM GAUSSIAN DISTRIBUTION
plt.figure(2)
plt.title('2D-Gaussian Distribution')
bins = plt.hist2d(s1, s2, 100)
cb = plt.colorbar()
cb.set_label('counts in bin')
#plt.axis('equal')
plt.show()
Thanks!