diff --git a/pyglotaran_extras/plotting/plot_data.py b/pyglotaran_extras/plotting/plot_data.py index 59b64ea0..84d2b2f2 100644 --- a/pyglotaran_extras/plotting/plot_data.py +++ b/pyglotaran_extras/plotting/plot_data.py @@ -1,9 +1,12 @@ from __future__ import annotations from typing import TYPE_CHECKING +from typing import cast import matplotlib.pyplot as plt +from matplotlib.axis import Axis +from pyglotaran_extras.io.load_data import load_data from pyglotaran_extras.plotting.plot_svd import plot_lsv_data from pyglotaran_extras.plotting.plot_svd import plot_rsv_data from pyglotaran_extras.plotting.plot_svd import plot_sv_data @@ -11,26 +14,24 @@ __all__ = ["plot_data_overview"] if TYPE_CHECKING: - from typing import cast - - import xarray as xr - from matplotlib.axis import Axis from matplotlib.figure import Figure from matplotlib.pyplot import Axes + from pyglotaran_extras.types import DatasetConvertible + def plot_data_overview( - dataset: xr.Dataset, + dataset: DatasetConvertible, title: str = "Data overview", linlog: bool = False, linthresh: float = 1, - figsize: tuple[int, int] = (30, 15), + figsize: tuple[int, int] = (15, 10), ) -> tuple[Figure, Axes]: """Plot data as filled contour plot and SVD components. Parameters ---------- - dataset : Dataset + dataset : DatasetConvertible Dataset containing data and SVD of the data. title : str, optional Title to add to the figure., by default "Data overview" @@ -45,6 +46,8 @@ def plot_data_overview( tuple[Figure, Axes] Figure and axes which can then be refined by the user. """ + dataset = load_data(dataset) + fig = plt.figure(figsize=figsize) data_ax = cast(Axis, plt.subplot2grid((4, 3), (0, 0), colspan=3, rowspan=3, fig=fig)) lsv_ax = cast(Axis, plt.subplot2grid((4, 3), (3, 0), fig=fig))