Debian Codegraph @

doc/tutorialsexercises/opticalresponse/circular_dichroism/fd/plot_spectrum.py

raw
1 # web-page: spectrum.png
2 import numpy as np
3 import matplotlib.pyplot as plt
4
5 fig, ax = plt.subplots(figsize=(6, 6 / 1.62))
6 data_ej = np.loadtxt('rot_spec.dat')
7 ax.plot(data_ej[:, 0], data_ej[:, 1], 'k', label='FD mode')
8 ax.spines['right'].set_visible(False)
9 ax.spines['top'].set_visible(False)
10 ax.yaxis.set_ticks_position('left')
11 ax.xaxis.set_ticks_position('bottom')
12 plt.title(r'Rotatory strength of (R)-methyloxirane')
13 plt.xlabel('Energy (eV)')
14 plt.legend(loc='upper left')
15 plt.ylabel(r'R (10$^{-40}$ cgs eV$^{-1})$')
16 plt.xlim(0, 10)
17 plt.ylim(-80, 80)
18 plt.tight_layout()
19 plt.savefig('spectrum.png')