If I generate a 1-D probability distribution and get a result like below:
How can I convert this into a two-dimensional contourf plot, assuming the y-axis would be the same as the x-axis. Below, I created an image of what I would like the result to look like, where each band is repesentative of a range of probabilities. The bands would change with different x.
My code to generate the 1-D plot is below:
import matplotlib.pyplot as plt
import numpy as np
def gaussian(x, mu, sig):
return np.exp(-np.power(x - mu, 2.) / (2 * np.power(sig, 2.)))
x_values = np.linspace(-5, 5, 120)
y = gaussian(x_values, 0, 1)
plt.figure()
plt.plot(x_values,y)
plt.show()