As of Matplotlib 3.1, mlab.bivariate_normal is removed from matplotlib's library. I was wondering if there is a built-in class that does the same job elsewhere (or in matplotlib)? I searched for a bit but can't find it readily.
I realize that one can just copy the function here and use it but I was wondering if there is a built-in function that one can call.
As suggested by @tmdavison,
scipy.stats.multivariate_normal()
can be used to replacematplotlib.mlab.bivariate_normal()
.The call:
becomes:
The
matplotlib.mlab.bivariate_normal()
function had default values for all arguments exceptX
andY
so you may have to add some extra values. Thesig_x
andsig_y
values defaulted to1.0
and all other arguments defaulted to0.0
. So if you are replacing the callbivariate_normal(X, Y)
it would becomemultivariate_normal([0, 0], [[1, 0], [0, 1]]).pdf(np.dstack((X, Y)))
.