Skip to content

Commit a365496

Browse files
mistraubedrammock
andauthored
FIX: Fix axis spines zorder in plot_evoked (#13549)
Co-authored-by: Daniel McCloy <dan@mccloy.info>
1 parent bb2bdc1 commit a365496

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

doc/changes/dev/13549.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix bug with :func:`mne.viz.plot_evoked` where channels were plotted above axis spines, by `Michael Straube`_.

mne/viz/evoked.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,10 @@ def _plot_lines(
808808
# Put back the y limits as fill_betweenx messes them up
809809
ax.set_ylim(this_ylim)
810810

811+
# Ensure the axis spines are drawn above all Line2D artists
812+
max_zorder = max((line.get_zorder() for line in ax.get_lines()), default=0) + 1
813+
ax.spines[:].set_zorder(max_zorder)
814+
811815
lines.append(line_list)
812816

813817
if selectable:

0 commit comments

Comments
 (0)