-
Notifications
You must be signed in to change notification settings - Fork 93
/
nebplt.py
executable file
·49 lines (39 loc) · 1.09 KB
/
nebplt.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from subprocess import call
plt.style.use('ggplot')
############################################################
# Generating and Loading data
# call vtst scripts to generate the MEP.
call('nebbarrier.pl')
call('nebspline.pl')
# scatters of the barrier
mep_d = np.loadtxt('neb.dat')
# splines of the barrier
mep_s = np.loadtxt('spline.dat')
############################################################
# Plotting
nrows = 1; ncols = 1
fig = plt.figure(
figsize = (4.8, 2.4)
)
axes = [
plt.subplot(nrows, ncols, ii+1)
for ii in range(ncols * nrows)
]
axes[0].plot(mep_s[:,1], mep_s[:,2], ls='-', lw=0.5, color='r', alpha=0.8)
axes[0].plot(mep_d[:,1], mep_d[:,2], ls='none',
marker='*', ms=6, mew=0, mfc='b')
axes[0].set_xlabel('Reaction Coordinate', labelpad=5)
axes[0].set_ylabel('Energy [eV]', labelpad=5)
plt.tight_layout()
# plt.show()
plt.savefig('mep.png', dpi=300)
try:
from subprocess import call
call('feh -xdF mep.png'.split())
except:
pass