diff --git a/python/plots/plot_eps_vs_energy.py b/python/plots/plot_eps_vs_energy.py index 4214b48..7665170 100644 --- a/python/plots/plot_eps_vs_energy.py +++ b/python/plots/plot_eps_vs_energy.py @@ -31,9 +31,11 @@ def plot_dielectric_function_vs_energy(dirname): qx = float(filestem.split('_')[-3]) print(qx, qy, qz) list_q.append(np.sqrt(qx**2 + qy**2 + qz**2)) + print(list_q) list_files = [x for _, x in sorted(zip(list_q, list_files))] cmap = plt.get_cmap('jet') + norm = mpl.colors.Normalize(vmin=min(list_q), vmax=max(list_q)) fig, ax = plt.subplots() diff --git a/python/plots/simple_plot_eps_vs_energy.py b/python/plots/simple_plot_eps_vs_energy.py new file mode 100644 index 0000000..247b7be --- /dev/null +++ b/python/plots/simple_plot_eps_vs_energy.py @@ -0,0 +1,41 @@ +import matplotlib as mpl +import numpy as np +import pandas as pd +from pathlib import Path +import matplotlib.pyplot as plt +from argparse import ArgumentParser +from matplotlib.lines import Line2D +from scipy.interpolate import CubicSpline +from pathlib import Path + +import sys, glob + +try: + import scienceplots + plt.style.use(['science', 'muted']) +except Exception: + print('Could not load style sheet') + None + plt.style.use(['seaborn-paper']) + +mpl.rcParams['figure.figsize'] = [3.5, 2.8] + + +def plot_dielectric_function_vs_energy(filename): + energy, eps_r, eps_i = np.loadtxt(filename, delimiter=",", skiprows=1, unpack=True) + fig, axs = plt.subplots() + axs.plot(energy, eps_r, label="$\eps_r", c="r") + axs.plot(energy, eps_i, label="$\eps_u", c='b') + + axs.set_ylabel("Relative dielectric function") + axs.set_xlabel("Energy (eV)") + fig.tight_layout( ) + + plt.show() + + +if __name__ == "__main__": + file = sys.argv[1] + plot_dielectric_function_vs_energy(file) + + \ No newline at end of file