Advertisement
MdSadmanSiraj

bar_plot

Sep 19th, 2022 (edited)
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.06 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_es_better = [4.35, 5.556, 10.126, 28.276, 58.699] # [n25, n50, n100, n200, n300]
  3.  
  4. width = 0.10
  5. bar_space = 0.15
  6. N_T_scale = np.array([1, 2, 3, 4, 5])
  7. fig = plt.figure()
  8. ax = fig.add_subplot()
  9.  
  10. plt.bar(N_T_scale - 0.7*width, system_exec_time_es_best, width=bar_space, color="red", label='Best Response')
  11. plt.bar(N_T_scale + 0.7*width, system_exec_time_es_better, width=bar_space, color="mediumblue", label='Better Response')
  12.  
  13. plt.xlabel("Number of Strategy Segments ($n_{seg}$)", fontsize=24)
  14. plt.ylabel("Execution Time (s)", fontsize=24)
  15. plt.text(0.03, 0.95, '(a)', transform=ax.transAxes, fontsize=24, fontweight='bold', va='top')
  16. plt.xticks([1, 2, 3, 4, 5], ['25', '50', '100', '200', '300'])
  17. plt.legend(prop={'size': 18}, loc='center left')
  18. # ax.set_ylim(0.0, 350)
  19. plt.savefig("graphs_v3/comparison/3_1.png", format='png', bbox_inches='tight', dpi=720)
  20. plt.savefig("graphs_v3/comparison/3_1.eps", format='eps', bbox_inches='tight', dpi=720)
  21. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement