Tube Yu
Tube Yu

Reputation: 11

How to set height of Barplot?

I try to set the height of a result of one barplot.

Can someone help me ?

Actually, I have this result ?

enter image description here

Thank you

Upvotes: 0

Views: 3732

Answers (1)

Dan
Dan

Reputation: 45762

I usually use the subplots function from matplotlib to control figure size. With seaborn you can often pass in a matplotlib axis.

import matplotlib.pyplot as plt
import seaborn as sns

height = 20
width = 10
fig, ax = plt.subplots(figsize=(height,width)) # I might have swapped height and width here, I never remeber which order they're in

# Do what you had before with barplot just pass in your axis as the ax key word:
sns.barplot(..., ax=ax)

Upvotes: 1

Related Questions