How we can visualize a Gaussian distribution without any line on the shape itself (a smooth plot).
The shape I want:
The shape I got so far:
Here is my code:
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import multivariate_normal
# Parameters to set
mu_x = 0
variance_x = 5
mu_y = 0
variance_y = 5
# Create grid and multivariate normal
x = np.linspace(-10, 10, 500)
y = np.linspace(-10, 10, 500)
X, Y = np.meshgrid(x, y)
pos = np.empty(X.shape + (2,))
pos[:, :, 0] = X
pos[:, :, 1] = Y
rv = multivariate_normal([mu_x, mu_y], [[variance_x, 0], [0, variance_y]])
# Make a 3D plot
fig = plt.figure()
ax = fig.gca(projection='3d')
ax.plot_surface(X, Y, rv.pdf(pos), cmap='magma')
plt.axis('off')
# ax.view_init(90, 90)
plt.draw()
plt.savefig('test5.png', transparent=True)
plt.show()

