-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot.py
47 lines (39 loc) · 1.15 KB
/
plot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env python3
import argparse
import os
import seaborn as sns
import matplotlib.pyplot as plt
from baselines.common import plot_util as pu
sns.set()
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
"-d", "--dirs", help="List of log directories", required=True, nargs="*"
)
parser.add_argument("-ns", "--num_timesteps", type=float, default=1e6)
parser.add_argument("-x", "--xaxis", help="Varible on X-axis", default="timesteps")
parser.add_argument(
"-n", "--task_name", help="Title of plot", default="Qube Simulator"
)
args = parser.parse_args()
dirs = [os.path.abspath(folder) for folder in args.dirs]
xy_list = pu.load_results(dirs)
pu.plot_results(
xy_list,
# xy_fn=default_xy_fn,
# split_fn=lambda _: "",
# group_fn=default_split_fn,
average_group=True,
shaded_std=False,
shaded_err=True,
figsize=None,
legend_outside=False,
resample=0,
smooth_step=1.0,
tiling="vertical",
xlabel=args.xaxis,
ylabel="Reward",
)
plt.show()
if __name__ == "__main__":
main()