Posted in Python onJuly 10, 2019
如下所示:
import matplotlib.pyplot as plt import numpy as np import math def gaussian(sigma, x, u): y = np.exp(-(x - u) ** 2 / (2 * sigma ** 2)) / (sigma * math.sqrt(2 * math.pi)) return y #x = np.linspace(220, 230, 10000) x = np.linspace(-800, 800, 10000) plt.title('PDF in Horizontal Direction', fontsize=22) plt.xticks(fontsize=22) plt.yticks(fontsize=22) axes = plt.subplot(111) axes.set_xticks([-800,-400,0,400,800]) axes.set_yticks([0,0.001,0.002,0.0030]) plt.plot(x, gaussian(120, x, 0), "b-", linewidth=6) plt.show()
以上这篇Python画图高斯分布的示例就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持三水点靠木。
Python画图高斯分布的示例
- Author -
裂空大龙声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@