# -*- 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('H/YStress.dat',delimiter=',')
comp2 = []
comp2 = np.loadtxt('M1/YStress.dat',delimiter=',')
comp3 = []
comp3 = np.loadtxt('M2/YStress.dat',delimiter=',')
comp4 = []
comp4 = np.loadtxt('L/YStress.dat',delimiter=',')


ax.plot(comp[:,0],comp[:,1],color='r', lw=3,label='Opt-H')  # r
ax.plot(comp2[:,0],comp2[:,1],color='m', lw=3,label='Opt-M1')  # r
ax.plot(comp3[:,0],comp3[:,1],color='y', lw=3,label='Opt-M2')  # r
ax.plot(comp4[:,0],comp4[:,1],color='b', lw=3,label='Opt-L')  # r


ax.set_xlabel(u'$t$, min', fontsize=45, labelpad=20)
ax.set_ylabel(r'$V_{f}^{\gamma^{\prime}}$, percent', fontsize=45, labelpad=15)

ax.tick_params(axis='x', labelsize=30, pad = 15)
ax.tick_params(axis='y', labelsize=30, pad = 10)


ax.set_xscale("log", nonposx='clip')
ax.set_ylim(0, 100)


ax.xaxis.set_major_locator(LogLocator(base = 1000.0))
ax.set_xlim(1E-4, 1E6)
ax.locator_params(axis = 'y', nbins = 5)

handles, labels = ax.get_legend_handles_labels()
plt.legend(handles, labels, loc='upper left', fontsize=25)

fig.tight_layout()


plt.show()

