Skip to content

Instantly share code, notes, and snippets.

@nescobar
Created October 17, 2018 17:56
Show Gist options
  • Save nescobar/7bb8f84bacdf6638b993bb5b2d8a581d to your computer and use it in GitHub Desktop.
Save nescobar/7bb8f84bacdf6638b993bb5b2d8a581d to your computer and use it in GitHub Desktop.
plt.figure(figsize=(20,4))
countries = {'ARG':'Argentina','ESP':'Spain','SUI':'Switzerland','USA':'United States','SRB':'Serbia'}
colors = ['blue','magenta','red','grey','black']
i=1
for k,v in countries.items():
plt.subplot(1,5,i)
s = tennis_df[(tennis_df['tourney_level'] == 'G') & (tennis_df['winner_ioc'].isin([k]))].groupby(['tourney_year','winner_ioc'], as_index=False).agg('count')
plt.plot(s['tourney_year'], s['tourney_id'], color=colors[i-1], linestyle='dashed', marker='o', markerfacecolor='blue', markersize=2)
if i==1:
plt.ylabel('Number of Wins')
plt.title(v+' in GS')
i=i+1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment