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-!-tp24145696p24145696.html

Sent from the matplotlib - users mailing list archive at Nabble.com.