#!/usr/bin/env python
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
from math import erf

#Z	RPBE	H3@RPBE	RPBE@H3	H3
fcc_para3 = np.array(
[[2,	-42.35492732,	-14.26187924,	-25.46199022,	-36.72906201],
[2.1,	-30.79984689,	-5.636768149,	-20.57954421,	-29.20803229],
[2.2,	-22.59946412,	-4.441122219,	-16.57106211,	-20.20161126],
[2.3,	-16.47312952,	-2.114379029,	-12.50034698,	-10.05039206],
[2.4,	-11.3891257,	3.804705131,	-9.298675025,	0.006561001],
[2.5,	-7.294482218,	8.977475436,	-7.278851598,	7.562421916],
[2.6,	-4.341066955,	11.68958094,	-5.058917643,	11.39163432],
[2.7,	-2.390134037,	12.48085695,	-2.918005155,	12.72708746],
[2.8,	-1.184743091,	12.17181451,	-1.326576493,	12.77754927],
[2.9,	-0.489084024,	11.337892,	-0.339049371,	12.23520536],
[3,	-0.117519105,	10.32518221,	0.174927862,	11.50355727],
[3.1,	0.05962792,	9.350005209,	0.398291349,	10.75425237],
[3.2,	0.119062869,	8.462050924,	0.455603622,	10.07200476],
[3.3,	0.116361281,	7.853228633,	0.430324471,	9.483637359],
[3.4,	0.082687909,	7.207355985,	0.358732373,	9.00844722],
[3.5,	0.038015211,	6.846983361,	0.266202963,	8.636303389]]
)

mpl.rc("text", usetex=True)
fig = plt.figure(figsize=(3.,2.6))

plt.plot( fcc_para3[:,0], fcc_para3[:,1], label='RPBE')
plt.plot( fcc_para3[:,0], fcc_para3[:,2], label=r'HSE03-1/3X@RPBE')
plt.plot( fcc_para3[:,0], fcc_para3[:,3], label=r'RPBE@HSE03-1/3X')
plt.plot( fcc_para3[:,0], fcc_para3[:,4], label='HSE03-1/3X')

plt.plot([0.,5.],[0.,0.], color='k', ls='--')

plt.legend(loc='lower right', numpoints=1, scatterpoints=1, fontsize=9)
plt.xlim(2.,3.5)
plt.ylim(-40.,20.)
plt.tick_params(length=6, width=1, direction='in', top=True, right=True)
plt.ylabel('Potential energy (kJ/mol)')
plt.xlabel(r'$Z$ (\r{A})')

plt.tight_layout()
plt.savefig('reactioncoordinate.pdf')
#plt.show()
