Stanislav Jirak
Stanislav Jirak

Reputation: 853

How to change size of a seaborn barplot?

I want to adjust the size of my barplot to fit my data well.

I tried:

ax = sns.barplot(x=b1_df2.score/(-2), y='CountryCode', hue='question_code', data=b1_df2.loc[b1_df2.answer == 'Very widespread'])
plt.xlabel("Questions")
plt.ylabel("%")
plt.title("Title (very widespread)")
plt.figure(figsize=(50,10))

No effect seen no matter of the figsize parameters.

Upvotes: 0

Views: 5840

Answers (1)

mozway
mozway

Reputation: 260600

If you want to change the size afterwards, do:

plt.gcf().set_size_inches(50,10)

or:

ax.figure.set_size_inches(50,10)

Upvotes: 3

Related Questions