我有类似这样的图表。
我想将这个添加到
但是它返回了`AttributeError: 'Series' object has no attribute 'add_subplot'`。我该如何检查这个错误?
fig = plt.figure()
desire_salary = (df[(df['inc'] <= int(salary_people))])
print desire_salary
# Create the pivot_table
result = desire_salary.pivot_table('city', 'cult', aggfunc='count')
# plot it in a separate step. this returns the matplotlib axes
ax = result.plot(kind='bar', alpha=0.75, rot=0, label="Presence / Absence of cultural centre")
ax.set_xlabel("Cultural centre")
ax.set_ylabel("Frequency")
ax.set_title('The relationship between the wage level and the presence of the cultural center')
plt.show()
我想将这个添加到
subplot
。我尝试了。fig, ax = plt.subplots(2, 3)
...
ax = result.add_subplot()
但是它返回了`AttributeError: 'Series' object has no attribute 'add_subplot'`。我该如何检查这个错误?