ValueError(“couleur kwarg doit avoir une couleur par jeu de données”)?

Je viens de simplement enregistrer les données dans les fichiers et de les lire, puis de dessiner l'histogramme. Cependant, il semble que cette erreur mais j'ai rien changé à partir du code original en fait. Quelqu'un pourrait-il me dire quel est le problème? Merci beaucoup.

Voici le code pour hist()

f_120 = plt.figure(1)
plt.hist(tfirst_list, bins=6000000, normed = True, histtype ="step", cumulative = True, color = 'g',label = 'first answer')
plt.axvline(x = 30, ymin = 0, ymax = 1, color = 'r', linestyle = '--', label = '30 min')
plt.axvline(x = 60, ymin = 0, ymax = 1, color = 'c', linestyle = '--', label = '1 hour')
plt.legend()
plt.ylabel('Percentage of answered questions')
plt.xlabel('Minutes elapsed after questions are posted')
plt.title('Cumulative histogram: time elapsed \n before questions receive answer (first 2 hrs)')
plt.ylim(0,1)
plt.xlim(0,120)
f_120.show()
f_2640 = plt.figure(2)
plt.hist(tfirst_list, bins=6000000, normed = True, histtype ="step", cumulative = True, color = 'g',label = 'first answer')
plt.axvline(x = 240, ymin = 0, ymax = 1, color = 'r', linestyle = '--', label = '4 hours')
plt.axvline(x = 1440, ymin = 0, ymax = 1, color = 'c', linestyle = '--', label = '1 day')
plt.legend(loc= 4)
plt.ylabel('Percentage of answered questions')
plt.xlabel('Minutes elapsed after questions are posted')
plt.title('Cumulative histogram: time elapsed \n before questions receive answer (first 48)')
plt.ylim(0,1)
plt.xlim(0,2640)
f_2640.show()

Et il y a le texte intégral de l'erreur:

 plt.hist(tfirst_list, bins=6000000, normed = True, histtype ="step",
cumulative = True, color = 'b',label = 'first answer')
File "C:\Python26\lib\site-packages\matplotlib\pyplot.py", line 2160, in hist
ret = ax.hist(x, bins, range, normed, weights, cumulative, bottom, histtype,
align, orientation, rwidth, log, color, label, **kwargs)
File "C:\Python26\lib\site-packages\matplotlib\axes.py", line 7606, in hist
raise ValueError("color kwarg must have one color per dataset")
ValueError: color kwarg must have one color per dataset
InformationsquelleAutor AnneS | 2011-10-13