3
我想要一条曲线的曲线说x^5 + x^4 + x^3 + x + 1
每个点x都取自一个正态分布。 我有一个向量的手段和西格马值向量。绘制一个概率密度
使用matplotlib.pyplot
我可以绘制平均值,我可以围绕平均值绘制方差,但看起来不够优雅,并且会使输出杂乱。
是否有任何其他方式来绘制密度函数?
我用这样的事情:
mu = [mu1, mu2, mu3..]
sigma = [sigma1, sigma2, sigma3..]
variance1 = [mu1+sigma1, mu2+sigma2, ..]
variance2 = [mu1-sigma1, mu2-sigma2,..]
import matplotlib.pyplot as plt
plt.plot(x,mu)
plt.plot(x,variance1, ls = "--")
plt.plot(x,variance2,ls="--")
其中x
是输入数组。
'imshow'? '吧?我们需要更多地了解您的图表,其他元素以及示例的外观。示例代码作为起点也会有所帮助 –