I have the old faithfutl data set, and I want to replicate this plot:
I do not know how to plot it. I have the mean and the variance. I know how to do it with a multivariate gaussian, but with the univariate one I am having this error: TypeError: Input z must be 2D, not 3D
This is my code:
t = np.linspace(1.5, 6, 100)
h = np.linspace(1.2, 6, 100)
w_0, w_1 = np.meshgrid(t, h)
z = stats.norm(u_ml,sig_ml).pdf(np.dstack((w_0,w_1)))
plt.contourf(t, h,z, cmap='plasma')