Ich habe Grundstücke wie diesesWie Grundstück hinzufügen matplotlib
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()
ich das subplot
hinzufügen möchten Nebenhandlung. Ich versuche
fig, ax = plt.subplots(2, 3)
...
ax = result.add_subplot()
aber es gibt Attribute: 'Series' Objekt hat kein Attribut ‚add_subplot'`. Wie kann ich diesen Fehler überprüfen?
tun Sie 6 Plots plotten möchten? – MaxU
@MaxU, Ja, ich möchte 6 Plot zu einem hinzufügen. Ich habe das separat, aber ich will das vereinen –
überprüfen Sie den Link, ich habe in meiner Antwort zur Verfügung gestellt - ich war dort fast das gleiche (ich war mit seaborn.boxplot statt Barplot, die Sie verwenden möchten) – MaxU