Issue
I am working on a dataset, in which there are IMDB ratings corresponding to each episode. I am wondering, why is there an error bar on my sns.barplot
?
There shouldn't be any, because the number is a single number and it's not an aggregation of any series of numbers.
Note: I know that I can remove the error bar with ci=None
parameter. Still, the main bar doesn't end at the determined point.
In:
pop_eps10 = frnds[['Episode_Title','Stars']].sort_values('Stars', ascending=False).head(10).reset_index(drop=True)
pop_eps10
Out:
In:
plt.figure(figsize=(10,5))
sns.barplot(y=pop_eps10.Episode_Title, x=pop_eps10.Stars, palette='Blues_d')
plt.title('Top 10 High-rated Episodes', fontsize=15)
plt.xlabel('IMDB Stars', fontsize=13)
plt.ylabel('Episode', fontsize=13)
plt.xticks(fontsize=12)
plt.yticks(fontsize=12)
plt.xlim(9, 10)
Out:
(source: googleapis.com)
After setting ci=None
:
(source: googleapis.com)
As you see, although there is no error bar, still the first bar is not ended at 9.7 (according to the table above).
Any opinion?
Solution
Because you have two rows of 'The Last One', each with value 9.7 and 9.5. Bar plot will take their average, which is 9.6.
Answered By - tianlinhe
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.