Created
March 28, 2018 13:42
-
-
Save cavedave/52febd2f02e0bcbff1afdf1eed1ba7a4 to your computer and use it in GitHub Desktop.
Does Carlsen just grind out wins against Caruana? I got their games from http://www.chessgames.com/perl/chess.pl?page=1&pid=52948&pid2=76172
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plt.figure(figsize=(10,6)) | |
colors = {'draw':'orange', 'win':'green', 'loss':'red'} | |
#h=df['result'].apply(lambda x: colors[x]) | |
#c=df['result'].apply(lambda x: colors[x]) | |
#swarm_plot = sns.swarmplot(y='Moves', x='Year', hue='result', data=df) | |
muted = ["#27e833", "#e7b416", "#cc3232"] | |
newPal = dict(win = muted[0], draw = muted[1], loss = muted[2]) | |
#sns.swarmplot(x="measurement", y="value", hue="species", data=iris,palette=newPal ) | |
swarm_plot = sns.swarmplot(y='Moves', x='Year', hue="result", data=df, palette=newPal) | |
plt.legend(bbox_to_anchor=(1, 1), loc=2,title='Carlsen') | |
plt.title('Carlsen Against Caruana') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment