Giù Marcer
5634f2f418
All the usefull plots were generated and the codes were suitably modified for this purpose.
47 lines
1.4 KiB
Python
47 lines
1.4 KiB
Python
import numpy as np
|
|
import matplotlib.pyplot as plt
|
|
|
|
|
|
def plot(table, title='', log=False):
|
|
plt.figure(figsize=(5, 2))
|
|
plt.rcParams['font.size'] = 8
|
|
plt.suptitle(title)
|
|
|
|
plt.subplot(111)
|
|
if log:
|
|
plt.xscale('log')
|
|
plt.title('EMD' + ' '*10, loc='right')
|
|
|
|
plt.plot(table[0], table[1], color='#92182b')
|
|
plt.tick_params(axis='y', labelcolor='#92182b')
|
|
plt.ylabel('average', color='#92182b')
|
|
plt.ticklabel_format(style='sci', axis='y',
|
|
scilimits=(0, 0), useMathText=True)
|
|
|
|
twin = plt.twinx()
|
|
twin.plot(table[0], table[2], color='gray')
|
|
twin.tick_params(axis='y', labelcolor='gray')
|
|
twin.set_ylabel('standard deviation', color='gray')
|
|
twin.ticklabel_format(style='sci', axis='y',
|
|
scilimits=(0, 0), useMathText=True)
|
|
|
|
# plt.subplot(212)
|
|
# if log:
|
|
# plt.xscale('log')
|
|
# plt.title('skewness', loc='right')
|
|
# plt.xlabel('RL rounds')
|
|
# plt.plot(table[0], table[3], color='xkcd:gray')
|
|
|
|
plt.tight_layout()
|
|
|
|
|
|
table = np.loadtxt('ex-6/plots/emd-round-noise.txt')
|
|
|
|
# plot(table[:27].T, title='noiseless', log=True)
|
|
plot(table[27:47].T, title=r'noise at $\sigma_N = 0.005$')
|
|
plt.savefig('notes/images/6-rounds-noise-0.005.pdf')
|
|
plot(table[47:67].T, title=r'noise at $\sigma_N = 0.01$')
|
|
plt.savefig('notes/images/6-rounds-noise-0.01.pdf')
|
|
plot(table[67:].T, title=r'noise at $\sigma_N = 0.05$')
|
|
plt.savefig('notes/images/6-rounds-noise-0.05.pdf')
|