fig = plt.figure(figsize=(10,6))
colors = [‘red’, ‘blue’, ‘green’, ‘orange’, ‘black’]
for i in range(5):
start_index = i*12
end_index = (i+1)*12
year = i + 1948
subset = unrate[start_index:end_index]
plt.plot(subset[‘MONTH’], subset[‘VALUE’], c=colors[i], label=year)
plt.legend(loc=‘upper left’)
plt.show()
#This is an exericse from course"exploratory data visualization"-multiple plots- exercise 10/13 Here is my codes, it passed as expected. But when I checked the answers, it converts the label to a string value, as it shows: label = str(1948 + i). #I don’t why we need to convert to a string value.