Как показать все графики, а не только последний график в блокноте jupyter, используя matplotlib? - PullRequest
0 голосов
/ 08 апреля 2019

Я хочу показать все 20 графиков, но это покажет мне только последний график. Ниже приведен код:

#Lets take a serie with the number of times each ingredient was used

for cuisine in df_grouped.groups.keys():
df_cuisine = df_grouped.get_group(cuisine);

s = df_cuisine[list(all_ingredients)].apply(pd.value_counts).fillna(0).transpose()[True]

# Finally, plot the 10 most used ingredients

fig = s.sort_values(inplace=False, ascending=False)[:10].plot(kind='bar', title = cuisine)
fig = fig.get_figure()
fig.tight_layout()
fig.savefig(cuisine + '_10_most_used_ingredients.jpg')
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...