Last active
July 17, 2019 18:10
-
-
Save Hanrui-Wang/f7e030048729c2d1bfeca2c1ad2fab9b to your computer and use it in GitHub Desktop.
basic plot using matplotlib
This file contains hidden or 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
| import matplotlib.pyplot as plt | |
| import matplotlib | |
| plt.figure(i, figsize=(5.5, 5)) | |
| plt.grid(True, linewidth=0.2) | |
| plt.plot(step, reward, linestyle=line_style[methods[i][ii]], linewidth=line_width[methods[i][ii]], color=colors[methods[i][ii]]) | |
| plt.ylim(top=y_top[i], bottom=y_bottom[i]) | |
| plt.xlim(left=0, right=10000) | |
| plt.rcParams.update({'font.size': 12}) | |
| plt.legend([legend[methods[i][0]], legend[methods[i][1]], legend[methods[i][2]], legend[methods[i][3]], legend[methods[i][4]], legend[methods[i][5]], legend[methods[i][6]]]) | |
| plt.rcParams.update({'font.size': 15}) | |
| plt.xlabel('Number of Simulations') | |
| plt.ylabel('Figure of Merit (Reward)') | |
| plt.title(title[i]) | |
| plt.savefig((envs[i] + '.pdf'), format='pdf') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment