Skip to content

Commit

Permalink
don't require matplotlib to import
Browse files Browse the repository at this point in the history
  • Loading branch information
sneakers-the-rat committed Nov 12, 2024
1 parent 52ea777 commit 1afd15b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions miniscope_io/plots/headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
plt = None


def buffer_count(headers: pd.DataFrame, ax: plt.Axes) -> plt.Axes:
def buffer_count(headers: pd.DataFrame, ax: "plt.Axes") -> "plt.Axes":
"""
Plot number of buffers by time
"""
Expand All @@ -32,7 +32,7 @@ def buffer_count(headers: pd.DataFrame, ax: plt.Axes) -> plt.Axes:
return ax


def dropped_buffers(headers: pd.DataFrame, ax: plt.Axes) -> plt.Axes:
def dropped_buffers(headers: pd.DataFrame, ax: "plt.Axes") -> "plt.Axes":
"""
Plot number of buffers by time
"""
Expand All @@ -42,7 +42,7 @@ def dropped_buffers(headers: pd.DataFrame, ax: plt.Axes) -> plt.Axes:
return ax


def timestamps(headers: pd.DataFrame, ax: plt.Axes) -> plt.Axes:
def timestamps(headers: pd.DataFrame, ax: "plt.Axes") -> "plt.Axes":
"""
Plot frame number against time
"""
Expand All @@ -57,7 +57,7 @@ def timestamps(headers: pd.DataFrame, ax: plt.Axes) -> plt.Axes:
return ax


def battery_voltage(headers: pd.DataFrame, ax: plt.Axes) -> plt.Axes:
def battery_voltage(headers: pd.DataFrame, ax: "plt.Axes") -> "plt.Axes":
"""
Plot battery voltage against time
"""
Expand All @@ -70,7 +70,7 @@ def battery_voltage(headers: pd.DataFrame, ax: plt.Axes) -> plt.Axes:

def plot_headers(
headers: pd.DataFrame, size: Optional[Tuple[int, int]] = None
) -> (plt.Figure, plt.Axes):
) -> ("plt.Figure", "plt.Axes"):
"""
Plot the headers (generated from :meth:`.Frame.to_df` )
Expand Down Expand Up @@ -151,7 +151,7 @@ def __init__(

def _init_plot(
self,
) -> tuple[plt.Figure, dict[str, plt.Axes], dict[str, plt.Line2D]]:
) -> tuple["plt.Figure", dict[str, "plt.Axes"], dict[str, "plt.Line2D"]]:

# initialize matplotlib
plt.ion()
Expand Down

0 comments on commit 1afd15b

Please sign in to comment.