import matplotlib.pyplot as plt
import matplotlib.pylab as pylab
import scipy.io
import numpy as np
params={
'axes.labelsize': '35',
'xtick.labelsize':'27',
'ytick.labelsize':'27',
'lines.linewidth':2 ,
'legend.fontsize': '27',
'figure.figsize' : '12, 9'
}
pylab.rcParams.update(params)
x1 = [-20,-15,-10,-5,0,0,5,10,15,20]
y1 = [0,0.04,0.1,0.21,0.39,0.74,0.78,0.80,0.82,0.85]
y2 = [0,0.014,0.03,0.16,0.37,0.78,0.81,0.83,0.86,0.92]
y3 = [0,0.001,0.02,0.14,0.34,0.77,0.82,0.85,0.90,0.96]
y4 = [0,0,0.02,0.12,0.32,0.77,0.83,0.87,0.93,0.98]
y5 = [0,0,0.02,0.11,0.32,0.77,0.82,0.90,0.95,1]
plt.plot(x1,y1,'bo-',label='m=2, p=10%',markersize=20)
plt.plot(x1,y2,'gv-',label='m=4, p=10%',markersize=20)
plt.plot(x1,y3,'ys-',label='m=6, p=10%',markersize=20)
plt.plot(x1,y4,'ch-',label='m=8, p=10%',markersize=20)
plt.plot(x1,y5,'mD-',label='m=10, p=10%',markersize=20)
fig1 = plt.figure(1)
axes = plt.subplot(111)
axes.set_xticks([-20,-15,-10,-5,0,5,10,15,20])
axes.set_yticks([0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0])
axes.grid(True)
plt.legend(loc="lower right")
plt.ylabel('Percentage')
plt.xlabel('Difference')
plt.savefig('plot_test1.png',dpi = 1000,bbox_inches='tight')
plt.show()