📜  绘制正态分布 python 代码示例

📅  最后修改于: 2022-03-11 14:45:28.715000             🧑  作者: Mango

代码示例1
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as stats
import math

mu = 0
variance = 1
sigma = math.sqrt(variance)
x = np.linspace(mu - 3 * sigma, mu + 3 * sigma, 100)
plt.plot(x, stats.norm.pdf(x, mu, sigma))
plt.show()