I am completely new to Matplotlib. I can’t seem to get my script (a copy and paste from a Histogram example) to generate a graph. When I run my script, the command prompt returns.
Is there something I am missing?
···
histogram.py
import numpy as np
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
mu, sigma = 100, 15
x = mu + sigma*np.random.randn(10000)
the histogram of the data
n, bins, patches = plt.hist(x, 50, normed=1, facecolor=‘green’, alpha=0.75)
add a ‘best fit’ line
y = mlab.normpdf( bins, mu, sigma)
l = plt.plot(bins, y, ‘r–’, linewidth=1)
El mié, 19-11-2008 a las 10:49 -0500, Ron Brennan escribió:
Hello,
I am completely new to Matplotlib. I can't seem to get my script (a
copy and paste from a Histogram example) to generate a graph. When I
run my script, the command prompt returns.
Is there something I am missing?
#
# histogram.py
#
import numpy as np
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
mu, sigma = 100, 15
x = mu + sigma*np.random.randn(10000)
# the histogram of the data
n, bins, patches = plt.hist(x, 50, normed=1, facecolor='green',
alpha=0.75)
# add a 'best fit' line
y = mlab.normpdf( bins, mu, sigma)
l = plt.plot(bins, y, 'r--', linewidth=1)
Calling with:
python histogram.py
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net matplotlib-users List Signup and Options