Advertisement
MdSadmanSiraj

pairwise_bar_graph.py

Jan 20th, 2023
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.10 KB | None | 0 0
  1. system_exec_time_es_best = [7.348, 10.527, 20.433, 63.967, 125.726] # [n25, n50, n100, n200, n300]
  2. system_exec_time_not_es_best = [7.976, 12.929, 29.956, 80.652, 184.951] # [n25, n50, n100, n200, n300]
  3. system_exec_time_es_better = [4.35, 5.556, 10.126, 28.276, 58.699] # [n25, n50, n100, n200, n300]
  4. system_exec_time_not_es_better = [4.964, 7.971, 19.562, 64.928, 140.889] # [n25, n50, n100, n200, n300]
  5.  
  6. width = 0.10
  7. bar_space = 0.15
  8. N_T_scale = np.array([1, 2, 3, 4, 5])
  9. fig = plt.figure()
  10. ax = fig.add_subplot()
  11. # plt.bar(N_T_scale - 2.2*width, system_exec_time_es_best, width=bar_space, color="red", label='Best Response, Early Stopping')
  12. # plt.bar(N_T_scale - 0.7*width, system_exec_time_not_es_best, width=bar_space, color="green", label='Best Response, Extensive Form')
  13. # plt.bar(N_T_scale + 0.7*width, system_exec_time_es_better, width=bar_space, color="mediumblue", label='Better Response, Early Stopping')
  14. # plt.bar(N_T_scale + 2.2*width, system_exec_time_not_es_better, width=bar_space, color="orange", label='Better Response, Extensive Form')
  15.  
  16. plt.bar(N_T_scale - 0.7*width, system_exec_time_es_best, width=bar_space, color="red", label='Best Response')
  17. plt.bar(N_T_scale + 0.7*width, system_exec_time_es_better, width=bar_space, color="mediumblue", label='Better Response')
  18.  
  19. # plt.plot(N_T_scale - 0.7*width, trade_off_values_es, color = 'blue', marker = 'o', markerfacecolor='limegreen', markersize = 13, linestyle = 'solid')
  20. # plt.plot(N_T_scale + 0.7*width, trade_off_values_not_es, color = 'red', marker = 'o', markerfacecolor='limegreen', markersize = 13, linestyle = 'solid')
  21.  
  22. plt.xlabel("Number of Strategy Segments ($n_{seg}$)", fontsize=24)
  23. plt.ylabel("Execution Time (s)", fontsize=24)
  24. plt.text(0.03, 0.95, '(a)', transform=ax.transAxes, fontsize=24, fontweight='bold', va='top')
  25. plt.xticks([1, 2, 3, 4, 5], ['25', '50', '100', '200', '300'])
  26. plt.legend(prop={'size': 18}, loc='center left')
  27. # ax.set_ylim(0.0, 350)
  28. plt.savefig("graphs_v3/comparison/3_1.png", format='png', bbox_inches='tight', dpi=720)
  29. plt.savefig("graphs_v3/comparison/3_1.eps", format='eps', bbox_inches='tight', dpi=720)
  30. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement