我有数据错误matplotlib
city inc pop edu crime cult
New-York 29343,00 8683,00 0,00 10,40 0,00
Moscow 25896,00 17496,00 0,00 10,20 1,0
Rome 21785,00 15063,00 0,00 14,20 1,00
London 20000,00 70453,00 1,00 18,00 1,00
Berlin 44057,00 57398,00 1,00 6,30 1,00
我尝试建立的情节和plot
给出名称和改变颜色,列
desire_salary = (df[(df['inc'] >= int(salary_people))])
fig = plt.figure()
result = desire_salary.pivot_table('city', 'cult', aggfunc='count').plot(kind='bar', alpha=0.75, rot=0, label="Presence/Absence of cultural centre")
plt.xlabel("Cultural centre")
plt.ylabel("Frequency")
plt.set_title('Salary and culture')
plt.plot(result[[0]], color='red')
plt.plot(result[[1]], color='blue')
plt.show()
但它返回错误AttributeError: 'module' object has no attribute 'set_title'
和
写'plt.title( “有些题”)' – Serenity