此问题在此处已有答案:
Turn off errorbars in Seaborn Bar Plot(3个答案)
十小时前关门了。
这篇文章是10小时前编辑并提交审查的。
**编辑:**理解为什么错误条出现,为什么我需要将其设置为12而不是10,有2个重复的名称为侠盗猎车手和使命召唤,有没有一种方法将这两个重复(基于这些游戏的控制台)结合到NA_Sales?
代码如下:
#Setting up enviornment
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
df = pd.read_csv('Video_Games.csv')
%matplotlib inline
#Most sucessful games NA after 2010
#Boolean Filtering for year
filtered_df = df[df[('Year_of_Release')] > 2010]
#Bar Chart creation
sns.barplot(x='Name',
y='NA_Sales',
data = filtered_df.nlargest(12, 'NA_Sales'))
plt.xticks(rotation=90)
plt.title('Most Successful Games in North America by Revenue')
plt.xlabel('Game Title')
plt.ylabel('Revenue (in the Millions)')
plt.rc('xtick', labelsize=8)
plt.grid(axis="y")
输出:
1条答案
按热度按时间az31mfrm1#
使用
errorbar=None
作为sns.barplot
的参数来删除误差条: