diff --git a/doc/changes/dev/13549.bugfix.rst b/doc/changes/dev/13549.bugfix.rst new file mode 100644 index 00000000000..5c0d111f40c --- /dev/null +++ b/doc/changes/dev/13549.bugfix.rst @@ -0,0 +1 @@ +Fix bug with :func:`mne.viz.plot_evoked` where channels were plotted above axis spines, by `Michael Straube`_. diff --git a/mne/viz/evoked.py b/mne/viz/evoked.py index 58265ccd37e..c12c1f0945e 100644 --- a/mne/viz/evoked.py +++ b/mne/viz/evoked.py @@ -808,6 +808,10 @@ def _plot_lines( # Put back the y limits as fill_betweenx messes them up ax.set_ylim(this_ylim) + # Ensure the axis spines are drawn above all Line2D artists + max_zorder = max((line.get_zorder() for line in ax.get_lines()), default=0) + 1 + ax.spines[:].set_zorder(max_zorder) + lines.append(line_list) if selectable: