seaborn, how do i keep true values from data for x axis

Viewed 57

I have a dataset that looks something like this:

HomeTeam FTHG
Arsenal 9
Bournemouth 2
Brighton 6
Burnley 3 Man City 20
.....and so on

I am trying to plot an sns.barplot(), and it came out fine except the x axis scale for the number of goals (FTHG) has been made relative. ie the x axis goes 0.0,0.5,1.0.... with man citys bar reaching 4.0.

How do i keep the true number of goals as the axis

my code for plotting the plot is:

dfaug_AWAY = dfaug.drop(columns=['Div', 'Date', 'HomeTeam','Referee', 'FTHG', 'HTHG','HS', 'FTR', 'HTHG','HST','HF', 'HTR', 'HC', 'HY', 'HR', 'Losing Team', 'Winning Team', 'year', 'month'])
dfaug_AWAY.groupby('AwayTeam').sum().reset_index()


fig, fig.set_size_inches(15,100)
sns.barplot(data = dfaug_AWAY, x='FTAG',y='AwayTeam',ci=None)
plt.title('NUMBER OF AWAY GOALS SCORED IN AUGUST WINDOW')
plt.xlabel('Away Goals')
0 Answers
Related