【发布时间】:2020-12-23 10:47:41
【问题描述】:
stars = [9.7, 9.7, 9.5, 9.5, 9.4, 9.3, 9.3, 9.3, 9.2, 9.2]
episodes = ['The Last One',
'The One Where Everybody Finds Out',
'The Last One',
'The One with the Embryos',
'The One with the Prom Video',
'The One with the Rumor',
'The One with the Proposal',
'The One with the Videotape',
"The One with Monica and Chandler's Wedding: Part 2",
"The One with Ross's Wedding"]
sns.barplot(stars, episodes, palette='inferno')
plt.xlabel('Stars')
plt.ylabel('Episodes')
plt.title('Top 10 Episodes according to Stars')
plt.xlim(9,10)
plt.show()
你好开发者,请帮助我! 为什么我在第一个小节中得到一条意外的线?
【问题讨论】:
-
您有两个同名的条目。 Seaborn 然后显示他们的平均值和一个错误栏。如果你真的想要最后两个条目,你可以在其中一个上添加一个额外的空格。
-
明白了,我没有在数据中注意到这一点。
标签: python matplotlib bar-chart seaborn visualization