"""
This file loads the error rate data and plots the box-whisker diagrams for the 
25 networks in the Simulations section.

The files error_wPC_freq.npy, error_wPH_freq.npy, and error_wPC_time.npy are obtained 
using the FD based W-PC, Wiener-phase, and TD based W-PC algorithms. These files were
generated using the script "Wiener_PC_time_vs_FFT_random_networks_sparsity_tuned.py" 
"""


import matplotlib.pyplot as plt
import numpy as np

data1 = np.load('error_wPC_freq.npy')
fig, ax = plt.subplots()
ax.set_ylabel('Error Rate')
ax.set_xlabel('Number of Samples')
plt.title("W-PC FD")
bplot = ax.boxplot(data1,patch_artist=True, labels=["640", "3200", "6400", "32000", "1280000", "320000"])
plt.show()


data2 = np.load('error_wPH_freq.npy')
fig, ax = plt.subplots()
ax.set_ylabel('Error Rate')
ax.set_xlabel('Number of Samples')
plt.title("Wiener-phase")
bplot = ax.boxplot(data2,patch_artist=True, labels=["640", "3200", "6400", "32000", "1280000", "320000"])
plt.show()


data3 = np.load('error_wPC_time.npy')
fig, ax = plt.subplots()
ax.set_ylabel('Error Rate')
ax.set_xlabel('Number of Samples')
plt.title("W-PC TD")
bplot = ax.boxplot(data3,patch_artist=True, labels=["640", "3200", "6400", "32000", "1280000", "320000"])
plt.show()
