Issue
I can plot a normal bar plot with searborn, but when i specify orient = 'h'
nothing shows up in my plot.
df = pd.DataFrame(['A','A','A','B','B','C'],columns = ['letters'])
data =df.letters.value_counts()
sns.barplot(x = data.index, y = data)
With orient:
Solution
You have to swap x and y when you change orientation.
df = pd.DataFrame(['A','A','A','B','B','C'],columns = ['letters'])
data =df.letters.value_counts()
sns.barplot(y = data.index, x = data, orient='h')
Answered By - Oleg Medvedyev
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.