| 1 |
# web-page: abs_spec.png, rot_spec.png |
| 2 |
import numpy as np |
| 3 |
import matplotlib.pyplot as plt |
| 4 |
|
| 5 |
for name, specj in zip(['abs', 'rot'], [1, 2]): |
| 6 |
plt.figure(figsize=(6, 6 / 1.62)) |
| 7 |
ax = plt.subplot(1, 1, 1) |
| 8 |
for ecut, ls in zip([7, 8], ['k--', 'k']): |
| 9 |
data_ej = np.loadtxt('spectrum_with_%05.2feV.dat' % ecut) |
| 10 |
ax.plot(data_ej[:, 0], data_ej[:, specj], ls, label=f'{ecut:.2f} eV') |
| 11 |
ax.spines['right'].set_visible(False) |
| 12 |
ax.spines['top'].set_visible(False) |
| 13 |
ax.yaxis.set_ticks_position('left') |
| 14 |
ax.xaxis.set_ticks_position('bottom') |
| 15 |
plt.xlabel('Energy (eV)') |
| 16 |
plt.legend(title='max_energy_diff') |
| 17 |
if name == 'abs': |
| 18 |
plt.ylabel('Photoabsorption (eV$^{-1}$)') |
| 19 |
elif name == 'rot': |
| 20 |
plt.ylabel('Rotatory strength (10$^{-40}$ cgs eV$^{-1}$)') |
| 21 |
plt.xlim(5, 10) |
| 22 |
plt.tight_layout() |
| 23 |
plt.savefig(f'{name}_spec.png') |