Hi everybody,
I have some probleme with Matplot/numpy !
I'm using matplot v0.91.2 and I'm trying to get the hist function working !!

I'm using the sample code of matplot:

----------------------------------------------------------
#!/usr/bin/env python
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)

print len(n)
print len(bins)

print n
print bins

# add a 'best fit' line
y = mlab.normpdf( bins, mu, sigma)
l = plt.plot(bins, y, 'r--', linewidth=1)

plt.xlabel('Smarts')
plt.ylabel('Probability')
plt.title(r'$\mathrm{Histogram\ of\ IQ:}\ \mu=100,\ \sigma=15$')
plt.axis([40, 160, 0, 0.03])
plt.grid(True)

plt.show()
------------------------------------------------------------

With the same matplot lib but a different version of numpy I get 2 different
number of bins !!! How is that possible ???
using the 1.0.4 version of numpy, I get len(n) = 50 and len(bins) = 50 ...
what sounds pretty right to me !! but using the version 1.2.1 (the last one
I guess) I got len(n) = 50 and len(bins) = 51 What looks weird, doesn't it
???

do you guys have an explanation ??
Anybody faced the same problem ?

thx, Jerome

-- 
View this message in context: 
http://www.nabble.com/Matplot-Numpy-possible-bug-%21-tp24145696p24145696.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to