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
__author__ = 'yuwenhao'

import gym
import sys, os, time

import joblib
import numpy as np

import matplotlib.pyplot as plt
import json

np.random.seed(1)

if __name__ == '__main__':
    ht_mean = np.loadtxt('data/force_data/action_mean_ht.txt')
    ht_std = np.loadtxt('data/force_data/action_std_ht.txt')
    our_mean = np.loadtxt('data/force_data/action_mean_our.txt')
    our_std = np.loadtxt('data/force_data/action_std_our.txt')

    fig = plt.figure()
    ax = fig.add_subplot(1, 1, 1)

    ax.plot(our_mean, 'g', label = 'ECL + MSL')
    ax.plot(ht_mean, 'y', label = 'PPO high torque')
    plt.legend()

    plt.title('Comparison on average action', fontsize=14)

    plt.xlabel("Timestep", fontsize=14)
    plt.ylabel("Average action", fontsize=14)

    for tick in ax.xaxis.get_major_ticks():
        tick.label.set_fontsize(13)
    for tick in ax.yaxis.get_major_ticks():
        tick.label.set_fontsize(13)

    plt.show()