# -*- coding: utf-8 -*-

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colorbar as clb
import matplotlib.patches as mpatches
import matplotlib.lines as mlines
from matplotlib.ticker import LogLocator

p_alpha = 1
fig, ax = plt.subplots(figsize=(12, 9))

comp = []
comp = np.loadtxt('2008B/YStress.dat',delimiter=',')
ref = []
ref = np.loadtxt('2008B/2008_Effects_Booth_Vf.dat')
eq = []
eq = np.loadtxt('2008B/eq_vf.dat')
comp2 = []
comp2 = np.loadtxt('2008S/YStress.dat',delimiter=',')
ref2 = []
ref2 = np.loadtxt('2008S/2008_Effects_sudbrack_Vf.dat')
eq2 = []
eq2 = np.loadtxt('2008S/eq_vf.dat')
comp3 = []
comp3 = np.loadtxt('2010B/YStress.dat',delimiter=',')
ref3 = []
ref3 = np.loadtxt('2010B/2010_on_Booth_Vf.dat')
eq3 = []
eq3 = np.loadtxt('2010B/eq_vf.dat')

#ax.errorbar(ref[:,0], ref[:,1], yerr=ref[:,2], s=150, marker='o', c='r',zorder=3)
ax.plot(eq[:,0],eq[:,1],"--",c='k',lw=2)
ax.errorbar(ref[:,0], ref[:,1], yerr=ref[:,2], fmt='o', c='r',markersize=15, lw=3, label='Kt1')
ax.plot(comp[:,0],comp[:,1],c='r',lw=3)
ax.plot(eq2[:,0],eq2[:,1],"--",c='k',lw=2)
ax.errorbar(ref2[:,0], ref2[:,1], yerr=ref2[:,2], fmt='o', c='b',markersize=15, lw=3, label='Kt2')
ax.plot(comp2[:,0],comp2[:,1],c='b',lw=3)
ax.plot(eq3[:,0],eq3[:,1],"--",c='k',lw=2)
ax.errorbar(ref3[:,0], ref3[:,1], yerr=ref3[:,2], fmt='o', c='g',markersize=15, lw=3, label='Kt3')
ax.plot(comp3[:,0],comp3[:,1],c='g',lw=3)

ax.set_xlabel(u'$t$, min', fontsize=45, labelpad=10)
ax.set_ylabel(r'V$_{f}$$^{\gamma^{\prime}}$, %', fontsize=45, labelpad=10)
ax.tick_params(axis='x', labelsize=30, pad = 10)
ax.tick_params(axis='y', labelsize=30, pad = 10)
ax.set_xscale("log", nonposx='clip')
ax.set_xlim(0.005, 8E5)
ax.set_ylim(0.0, 25)

ax.xaxis.set_major_locator(LogLocator(base = 1E2))
ax.locator_params(axis = 'y', nbins = 4)

handles, labels = ax.get_legend_handles_labels()
plt.legend(handles, labels, loc='upper left',numpoints=1, prop={'size':25})

#ax.grid(True)
fig.tight_layout()


plt.show()

