本文整理汇总了Python中matplotlib.mlab.normpdf方法的典型用法代码示例。如果您正苦于以下问题:Python mlab.normpdf方法的具体用法?Python mlab.normpdf怎么用?Python mlab.normpdf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在模块matplotlib.mlab的用法示例。
在下文中一共展示了mlab.normpdf方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: histogram_demo
点赞 6
# 需要导入模块: from matplotlib import mlab [as 别名]
# 或者: from matplotlib.mlab import normpdf [as 别名]
def histogram_demo(ax):
# example data
mu = 100 # mean of distribution
sigma = 15 # standard deviation of distribution
x = mu + sigma * np.random.randn(10000)
num_bins = 50
# The histogram of the data.
_, bins, _ = ax.hist(x, num_bins, normed=1, label='data')
# Add a 'best fit' line.
y = mlab.normpdf(bins, mu, sigma)
ax.plot(bins, y, '-s', label='best fit')
ax.legend()
ax.set_xlabel('Smarts')
ax.set_ylabel('Probability')
ax.set_title(r'Histogram of IQ: $\mu=100$, $\sigma=15$')
开发者ID:tonysyu,项目名称:matplotlib-style-gallery,代码行数:21,
示例2: plot_t_value_hist
点赞 6
# 需要导入模块: from matplotlib import mlab [as 别名]
# 或者: from matplotlib.mlab import normpdf [as 别名]
def plot_t_value_hist(
img_path='~/ni_data/ofM.dr/l1/as_composite/sub-5703/ses-ofM/sub-5703_ses-ofM_task-EPI_CBV_chr_longSOA_tstat.nii.gz',
roi_path='~/ni_data/templates/roi/DSURQEc_ctx.nii.gz',
mask_path='/usr/share/mouse-brain-atlases/dsurqec_200micron_mask.nii',
save_as='~/qc_tvalues.pdf',
):
"""Make t-value histogram plot"""
f, axarr = plt.subplots(1, sharex=True)
roi = nib.load(path.expanduser(roi_path))
roi_data = roi.get_data()
mask = nib.load(path.expanduser(mask_path))
mask_data = mask.get_data()
idx = np.nonzero(np.multiply(roi_data,mask_data))
img = nib.load(path.expanduser(img_path))
data = img.get_data()[idx]
(mu, sigma) = norm.fit(data)
n, bins, patches = axarr.hist(data,'auto',normed=1, facecolor='green', alpha=0.75)
y = mlab.normpdf(bins, mu, sigma)
axarr.plot(bins, y, 'r--', linewidth=2)
axarr.set_title('Histogram of t-values $\mathrm{(\mu=%.3f,\ \sigma=%.3f}$)' %(mu, sigma))
axarr.set_xlabel('t-values')
plt.savefig(path.expanduser(save_as))
开发者ID:IBT-FMI,项目名称:SAMRI,代码行数:27,代码来源:qc.py
示例3: plot_z
点赞 6