相关疑难解决方法(0)

Matplotlib.Pyplot不显示输出; 没有错误

我的平台如下

Centos 6.x(在Win-7主机上运行的VirtualBox VM),Python 2.6.6,Matplotlib 1.3.1,Numpy 1.8.0,Scipy 0.14.0.dev-bb608ba

我正在运行以下histogram.py代码

#!/usr/bin/env python

import numpy as np
import matplotlib.pyplot as plt

mu, sigma = 0, 1 # mean and standard deviation
f = np.random.normal(mu, sigma, 1000) # generate feature-vector with normal distribution

# plot the histogram - check the distribution
count, bins, ignored = plt.hist(f, 30, normed=True)

plt.plot(bins, 1/(sigma * np.sqrt(2 * np.pi)) *
                np.exp( - (bins - mu)**2 / (2 * sigma**2) ),
        linewidth=2, color='r')
plt.xlabel('Values')
plt.ylabel('Probability')
plt.title('Histogram')
plt.text(60, .025, r'$\mu=0,\ …
Run Code Online (Sandbox Code Playgroud)

python numpy matplotlib scipy

10
推荐指数
1
解决办法
3万
查看次数

标签 统计

matplotlib ×1

numpy ×1

python ×1

scipy ×1