Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
RemiHelleboid committed Apr 17, 2024
1 parent ec53eea commit 4fca68c
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/plots/plot_eps_vs_energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
41 changes: 41 additions & 0 deletions python/plots/simple_plot_eps_vs_energy.py
Original file line number Diff line number Diff line change
@@ -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)


0 comments on commit 4fca68c

Please sign in to comment.