ZeitgeberPlotter#
- class neurodent.plotting.ZeitgeberPlotter(data, features: list[str] | None = None, aggregate_config: dict | None = None)[source]#
Bases:
objectClass for generating, styling, and saving Zeitgeber temporal plots.
Can be initialized with either: - A list of ZeitgeberAnalysisResult objects (ZARs) - A pre-aggregated pandas DataFrame
- Parameters:
data – Either a list of ZARs or a DataFrame containing zeitgeber-processed data.
features – List of features to extract (only used if data is list of ZARs).
aggregate_config – Optional config for aggregation (only used if data is list of ZARs).
Examples
# From ZARs (interactive use) zars = [ZeitgeberAnalysisResult(war1, **config), …] plotter = ZeitgeberPlotter(zars, features=[“logpsdband”, “logrms”])
# From DataFrame (workflow use) df = pd.read_pickle(“zeitgeber_features.pkl”) plotter = ZeitgeberPlotter(df)
- plot_feature(feature, output_path, figsize, dpi=300, n_days=2)[source]#
Create and save a zeitgeber plot for a single feature.
- Parameters:
feature (
str) – Feature column name.output_path (
Path) – Path to save the figure.figsize (
list) – Figure size [width, height].dpi (
int) – DPI for the saved figure.n_days (
int) – Number of ZT cycles to span on the x-axis. Defaults to 2 (the legacy 48-hour view). The plotter materialises the multi-day expansion viaexpand_zt_axis()at render time so the persisted 24h dataframe is never duplicated on disk.