我有數據錯誤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