import matplotlib.pyplot as plt
import numpy as np

def load_values(filename):
    values = []
    with open(filename) as file:
        lines = file.readlines()
        values = [list(map(float, line.split(','))) for line in lines]        
        return np.array(values).mean(axis=0)

if __name__ == "__main__":

    fig, axs = plt.subplots(2, 1, figsize=(8,8))

    y11 = load_values("data/values_2000-1000-10_0-1_0-1_0.00.txt")
    y12 = load_values("data/values_2000-1000-10_0-1_0-1_0.01.txt")
    y13 = load_values("data/values_2000-1000-10_0-1_0-1_0.10.txt")
    y21 = load_values("data/maxQ_2000-1000-10_0-1_0-1_0.00.txt")
    y22 = load_values("data/maxQ_2000-1000-10_0-1_0-1_0.01.txt")
    y23 = load_values("data/maxQ_2000-1000-10_0-1_0-1_0.10.txt")
    x = np.linspace(1, len(y11), len(y11), endpoint=True)

    axs[0].set_ylabel('Mean value')
    axs[0].plot(x, y11, label="\u03B5 = 0.0")
    axs[0].plot(x, y12, label="\u03B5 = 0.01")
    axs[0].plot(x, y13, label="\u03B5 = 0.1")
    axs[0].legend()
    
    axs[1].set_ylabel('Mean of best picks [%]')
    axs[1].set_xlabel('steps')
    axs[1].plot(x, y21, x, y22, x, y23)

    plt.show()
import matplotlib.pyplot as plt
import numpy as np

def load_values(filename):
    values = []
    with open(filename) as file:
        lines = file.readlines()
        values = [list(map(float, line.split(','))) for line in lines]        
        return np.array(values).mean(axis=0)

if __name__ == "__main__":

    fig, axs = plt.subplots(2, 1, figsize=(8,8))

    y11 = load_values("data/values_2000-1000-10_0-1_0-1_0.00.txt")
    y12 = load_values("data/values_2000-1000-10_0-1_0-1_0.01.txt")
    y13 = load_values("data/values_2000-1000-10_0-1_0-1_0.10.txt")
    y21 = load_values("data/maxQ_2000-1000-10_0-1_0-1_0.00.txt")
    y22 = load_values("data/maxQ_2000-1000-10_0-1_0-1_0.01.txt")
    y23 = load_values("data/maxQ_2000-1000-10_0-1_0-1_0.10.txt")
    x = np.linspace(1, len(y11), len(y11), endpoint=True)

    axs[0].set_ylabel('Mean value')
    axs[0].plot(x, y11, label="\u03B5 = 0.0")
    axs[0].plot(x, y12, label="\u03B5 = 0.01")
    axs[0].plot(x, y13, label="\u03B5 = 0.1")
    axs[0].legend()
    
    axs[1].set_ylabel('Mean of best picks [%]')
    axs[1].set_xlabel('steps')
    axs[1].plot(x, y21, x, y22, x, y23)

    plt.show()