From 1d716e5fcbcf26fd17b93a2138aac014087a00fd Mon Sep 17 00:00:00 2001 From: Sean Kavanagh Date: Tue, 14 Jan 2025 23:21:38 +0000 Subject: [PATCH 1/2] Use `imshow` instead of `pcolormesh` --- easyunfold/plotting.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/easyunfold/plotting.py b/easyunfold/plotting.py index 93c1f0b..c96ff1c 100644 --- a/easyunfold/plotting.py +++ b/easyunfold/plotting.py @@ -234,7 +234,7 @@ def plot_spectral_function( 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 @@ -250,7 +250,14 @@ def plot_spectral_function( 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], + 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) From afa9e1781977beb3b214a306f87d99ac2f988a42 Mon Sep 17 00:00:00 2001 From: Sean Kavanagh Date: Tue, 14 Jan 2025 23:31:21 +0000 Subject: [PATCH 2/2] Fix small typo --- docs/examples/example_si222.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/examples/example_si222.md b/docs/examples/example_si222.md index fbc0e60..ff69dd3 100644 --- a/docs/examples/example_si222.md +++ b/docs/examples/example_si222.md @@ -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$)