I'm absolutely stumped as to why I'm getting this error. Any help will be appreciated!
This is the error info:
File "C:/Python27/Scripts/Lab08realdeal.py", line 23, in plt.hist(count,range=20,color = 'red')
File "C:\Python27\lib\site-packages\matplotlib\pyplot.py", line 2896, in hist stacked=stacked, **kwargs)
File "C:\Python27\lib\site-packages\matplotlib\axes_axes.py", line 5603, in hist raise ValueError("color kwarg must have one color per dataset")
ValueError: color kwarg must have one color per dataset
import csv
import matplotlib.pyplot as plt
def loadContaminantFrequencies(contaminant, fileInfo):
count= 0
for line in fileInfo:
if contaminant == line[0]:
count = count+1
return count
ifile = open('air_samples.csv',"rb")
fileInfo = csv.reader(ifile)
count = ("Benzene", fileInfo)
counts = [count,count]
plt.hist(count,range=20,color = 'red')
plt.xlabel("CountOfChemical")
plt.ylabel("Frequency")
plt.axes([0,3000,0,1])
plt.show()
type
problem, and you may want to look at: stackoverflow.com/a/60259377/12910854 – Arnold Vialfont