plot_spec.py 604 Bytes
Newer Older
Tuomas Rossi's avatar
Tuomas Rossi committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# Creates: Ag55_spec.png
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt

data_ej = np.loadtxt('spec.dat')

plt.figure(figsize=(6, 6 / 1.62))
ax = plt.subplot(1, 1, 1)
ax.plot(data_ej[:, 0], data_ej[:, 1], 'k')
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.yaxis.set_ticks_position('left')
ax.xaxis.set_ticks_position('bottom')
plt.title(r'Absorption spectrum of Ag$_{55}$ with GLLB-SC potential')
plt.xlabel('Energy (eV)')
plt.ylabel('Photoabsorption (eV$^{-1}$)')
plt.xlim(0, 6)
plt.ylim(ymin=0)
plt.tight_layout()
plt.savefig('Ag55_spec.png')