Skip to content

Commit

Permalink
Matplotlib fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrnr committed Jul 19, 2024
1 parent b69fd49 commit 2c2b0cd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/sleepecg/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
import numpy as np

if TYPE_CHECKING:
import matplotlib.pyplot as plt
from matplotlib.axes import Axes
from matplotlib.figure import Figure

from sleepecg.io.sleep_readers import SleepRecord, SleepStage
from sleepecg.utils import _STAGE_INTS, _STAGE_NAMES, _merge_sleep_stages, _time_to_sec
Expand All @@ -22,7 +23,7 @@ def plot_ecg(
fs: float,
title: str | None = None,
**kwargs: np.ndarray,
) -> tuple["plt.Figure", "plt.Axes"]:
) -> tuple[Figure, Axes]:
"""
Plot ECG time series with optional markers.
Expand Down Expand Up @@ -99,7 +100,7 @@ def plot_hypnogram(
stages_pred_duration: int = 30,
merge_annotations: bool = False,
show_bpm: bool = False,
) -> tuple["plt.Figure", list["plt.Axes"]]:
) -> tuple[Figure, list[Axes]]:
"""
Plot a hypnogram for a single record.
Expand Down Expand Up @@ -229,7 +230,7 @@ def plot_hypnogram(
def _plot_confusion_matrix(
confmat: np.ndarray,
stage_names: list[str],
) -> tuple["plt.Figure", "plt.Axes"]:
) -> tuple[Figure, Axes]:
"""
Create a labeled plot of a confusion matrix.
Expand Down

0 comments on commit 2c2b0cd

Please sign in to comment.