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$) 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)