Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import matplotlib.pyplot as plt
- ''' test data below - to be changed '''
- list_1 = [1000, 1019, 1027, 1037, 1029, 1028, 1043, 1066, 1056, 1046, 1046, 1067, 1075, 1075, 1085, 1078, 1089, 1105]
- list_2 = [1000, 986, 992, 1001, 1007, 1004, 1009, 997, 980, 984, 974, 977, 962, 942, 923, 915, 909, 890, 867, 843, 850]
- list_3 = [1000, 994, 995, 986, 997, 991, 984, 990, 1012, 1023, 1031, 1021, 1046, 1043, 1066, 1060, 1077, 1096, 1097, 1092, 1089]
- list_4 = [1000, 990, 977, 987, 982, 967, 973, 962, 968, 975, 980, 980, 990, 987, 988, 994]
- test_elo_dict = {
- 'Bo Hardin': list_1,
- 'Zack Kopstein': list_2,
- 'Tommy Hannan': list_3,
- 'Nick Charchut': list_4
- }
- ''' test data above - to be changed '''
- def elo_graph(dictionary):
- for i in dictionary.items():
- indiv_name = i[0]
- indiv_list = i[1]
- num_games = len(indiv_list)
- games_list = []
- for i in range(num_games):
- games_list.append(i+1)
- plt.plot(games_list, indiv_list, label = str(indiv_name) + ' - ELO: ' + str(indiv_list[-1]))
- handles, labels = plt.gca().get_legend_handles_labels()
- order = [a + " - ELO: " + str(test_elo_dict[a][-1]) for a in test_elo_dict.keys()]
- order.sort(key = lambda x: -int(x[-4:]))
- plt.legend(order, bbox_to_anchor=(1.01, 1), loc='upper left')
- # plt.legend(bbox_to_anchor=(1.01, 1), loc='upper left')
- plt.xlabel('# Games')
- plt.ylabel('ELO')
- elo_graph(test_elo_dict)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement