I'm trying to use a contour plot to visualize a multivariate normal distribution.
import numpy as np
from scipy.stats import multivariate_normal
mean = (0, 0)
cov = [[1, 0.75],
[0.75, 1]]
data = np.random.multivariate_normal(mean, cov,size=1000)
var = multivariate_normal(mean=mean, cov=cov)
z = var.pdf(data)
plt.contour(data,z)
>>>
ValueError: Contour levels must be increasing
My goal is simply a contour plot of the multivariate distribution, much like a 2D histogram. However, I seem to be misunderstanding the function's intent.
Is there a better way to accomplish this effect?