Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dist_final = [16.5173085362052, 14.876963985727059, 10.934011884128024, 8.358418078054424]
- system_error = [270.2912193825012, 440.3120792030492, 542.04230576983235, 669.4479629830983]
- dist_final = [round(item, 2) for item in dist_final]
- system_error = [round(item, 2) for item in system_error]
- game_rounds = [46, 29, 24, 20]
- labels = ['Var=5', 'Var=4', 'Var=3', 'Var=2']
- fig, error_axis = plt.subplots()
- x = np.arange(len(labels))
- distance_axis = error_axis.twinx()
- round_axis = error_axis.twinx()
- round_axis.spines.right.set_position(("axes", 1.13))
- width = 0.20
- barSpace = 0.40
- # color=['firebrick','red','darksalmon','darkblue','blue','royalblue']
- # width = 0.1
- p1 = error_axis.bar(x - width, np.log(system_error), width=width, color='red', align='center', label=r'$\eta_{ER,h}$')
- p2 = distance_axis.bar(x, dist_final, width=width, color='green', align='center', label=r'$\eta_{ER,h}$')
- p3 = round_axis.bar(x + width, game_rounds, width=width, color='mediumblue', align='center', label=r'$\eta_{ER,h}$')
- error_axis.yaxis.label.set_color("red")
- distance_axis.yaxis.label.set_color("green")
- round_axis.yaxis.label.set_color("mediumblue")
- tkw = dict(size=4, width=1.5)
- error_axis.tick_params(axis='y', colors="red", **tkw)
- distance_axis.tick_params(axis='y', colors="green", **tkw)
- round_axis.tick_params(axis='y', colors="mediumblue", **tkw)
- error_axis.tick_params(axis='x', **tkw)
- # lns = [p1, p2, p3]
- # distance_axis.legend(handles=lns, loc='best')
- # ax3.spines['right'].set_position(('outward', 60))
- # ax3.xaxis.set_ticks([])
- error_axis.set_xticks(x)
- error_axis.set_xticklabels(labels)
- error_axis.set_xlabel("Number of Variables", fontsize = 24)
- error_axis.set_ylabel("$ln$ [Overall Error Distance]", fontsize = 24)
- distance_axis.set_ylabel("Users' Avg. Dist. from Soc. Com.", fontsize = 24)
- round_axis.set_ylabel("Game Rounds", fontsize = 24)
- error_axis.set_ylim(5, 6.6)
- round_axis.set_ylim(10.0, 50)
- # plt.text(0.03, 0.95, '(f)', transform=error_axis.transAxes, fontsize=26, fontweight='bold', va='top')
- # plt.savefig("graphs_v3/comparative_results/2_f.png", format='png', bbox_inches='tight', dpi=720)
- # plt.savefig("graphs_v3/comparative_results/2_f.eps", format='eps', bbox_inches='tight', dpi=720)
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement