Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update band interpolation #56

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/examples/example_si222.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ output:
:alt: Spectral function
:width: 400px

Spectral function of the unfolded bands with out additional kpoints due to reduced symmetry.
Spectral function of the unfolded bands without additional kpoints due to reduced symmetry.
```

Comparing this plot with the one above, we see that we get spurious band breaking (e.g. along $\Gamma - L$)
Expand Down
11 changes: 9 additions & 2 deletions easyunfold/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
axes = [ax] if not isinstance(ax, list) else ax
fig = axes[0].figure

# Shift the kdist so the pcolormesh draw the pixel centred on the original point
# Shift the kdist so the plot draws the pixel centred on the original point
X, Y = np.meshgrid(kdist, engs - eref)

# Calculate the min and max values within the field of view, scaled by the factor
Expand All @@ -250,7 +250,14 @@
if contour_plot:
ax_.contourf(X, Y, sf[ispin], cmap=cmap, vmax=vmax, vmin=vmin, alpha=alpha)
else:
ax_.pcolormesh(X, Y, sf[ispin], cmap=cmap, shading='auto', vmax=vmax, vmin=vmin, alpha=alpha)
ax_.imshow(sf[ispin],

Check warning on line 253 in easyunfold/plotting.py

View check run for this annotation

Codecov / codecov/patch

easyunfold/plotting.py#L253

Added line #L253 was not covered by tests
cmap=cmap,
aspect='auto',
extent=(X.min(), X.max(), Y.min(), Y.max()),
vmin=vmin,
vmax=vmax,
alpha=alpha,
origin='lower')

ax_.set_xlim(xmin, xmax)
ax_.set_ylim(*ylim)
Expand Down
Loading