Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created December 23, 2020 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/bc5384b9cbd21ad11f529ba5b86bf820 to your computer and use it in GitHub Desktop.
Save amankharwal/bc5384b9cbd21ad11f529ba5b86bf820 to your computer and use it in GitHub Desktop.
trace1 = go.Bar(x=matches_played.index,y=matches_played['Total Matches'],
name='Total Matches',opacity=0.4)
trace2 = go.Bar(x=matches_played.index,y=matches_played['wins'],
name='Matches Won',marker=dict(color='red'),opacity=0.4)
trace3 = go.Bar(x=matches_played.index,
y=(round(matches_played['wins']/matches_played['Total Matches'],3)*100),
name='Win Percentage',opacity=0.6,marker=dict(color='gold'))
data = [trace1, trace2, trace3]
layout = go.Layout(title='Match Played, Wins And Win Percentage',xaxis=dict(title='Team'),
yaxis=dict(title='Count'),bargap=0.2,bargroupgap=0.1, plot_bgcolor='rgb(245,245,245)')
fig = go.Figure(data=data, layout=layout)
iplot(fig)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment