Problème de tracé d'un histogramme avec matplotlib

Résolu
boy63 Messages postés 7 Date d'inscription mardi 19 mai 2009 Statut Membre Dernière intervention 17 juin 2009 - 13 mai 2009 à 16:09
boy63 Messages postés 7 Date d'inscription mardi 19 mai 2009 Statut Membre Dernière intervention 17 juin 2009 - 19 mai 2009 à 08:17
Bonjour a tous!

Je rencontre un problème avec matplotib pour le tracé d'un histogramme. Je reçois un message d'erreur que je ne comprend pas. Exemple: en farfouillant sur le net j'ai trouvé ce script pour apprendre à tracer un histogramme:

import pylab
x = [1, 3, 3, 3, 4, 5, 5, 8, 8, 8, 8, 9]
pylab.hist(x, bins=5)

et la au lieu d'avoir un joli tracé j'obtiens l'erreur:

Warning (from warnings module):
  File "C:\Python25\lib\site-packages\numpy\lib\function_base.py", line 343
    """, Warning)
Warning:
            The semantics of histogram has been modified in
            the current release to fix long-standing issues with
            outliers handling. The main changes concern
            1. the definition of the bin edges,
               now including the rightmost edge, and
            2. the handling of upper outliers, now ignored rather
               than tallied in the rightmost bin.
            The previous behaviour is still accessible using
            `new=False`, but is scheduled to be deprecated in the
            next release (1.3).

            *This warning will not printed in the 1.3 release.*

            Use `new=True` to bypass this warning.

            Please read the docstring for more information.
           

Traceback (most recent call last):
  File "", line 1, in <module>
    pylab.hist(x, bins=5)
  File "C:\Python25\Lib\site-packages\matplotlib\pyplot.py", line 1633, in hist
    ret =  gca().hist(*args, **kwargs)
  File "C:\Python25\Lib\site-packages\matplotlib\axes.py", line 5117, in hist
    n, bins = npy.histogram(x, bins, range=None, normed=normed)
TypeError: 'NoneType' object is not iterable

Donc si quelqu'un sait d'où ça vient...
J'attends vos réponse avec impatiente. Merci d'avance.
A voir également:

1 réponse

boy63 Messages postés 7 Date d'inscription mardi 19 mai 2009 Statut Membre Dernière intervention 17 juin 2009
19 mai 2009 à 08:17
J'ai enfin trouvé le problème. La version de matplotlib me posé problème. En effet j'étais passé à une version permettant le 3D. Maintenant j'utilise la version 0.98.5.2 et je n'ai plus de problème. Donc voila si quelqu'un rencontre le problème essayer de changer de version de matplotlib.
3
Rejoignez-nous