Skip to content

Commit

Permalink
[Fix] events_plot now correctly returns a Figure
Browse files Browse the repository at this point in the history
- The documentation noted that the figure would be returned, however it
  did not
- This commit is based on the discussion in issue #1076
  • Loading branch information
DerAndereJohannes committed Feb 19, 2025
1 parent 9d6ffaa commit 0154fdf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion neurokit2/events/events_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def events_plot(events, signal=None, color="red", linestyle="--"):
signal = pd.DataFrame({"Signal": signal})

# Plot signal(s)
signal.plot()
axs = signal.plot()

# Check if events is list of lists
try:
Expand Down Expand Up @@ -144,3 +144,5 @@ def events_plot(events, signal=None, color="red", linestyle="--"):
newLabels.append(label)
newHandles.append(handle)
plt.legend(newHandles, newLabels)

return axs.get_figure()

0 comments on commit 0154fdf

Please sign in to comment.