AnimalPlotter#
- class neurodent.visualization.AnimalPlotter(war: WindowAnalysisResult, save_fig: bool = False, save_path: Path | None = None)[source]#
Bases:
AnimalFeatureParserClass for plotting results from an AnimalOrganizer/WindowAnalysisResult.
- Parameters:
war (
WindowAnalysisResult) – The analysis results to plot.save_fig (
bool, optional) – Whether to save figures to disk. Defaults to False.save_path (
Path, optional) – Directory where figures will be saved. Defaults to None.
- Variables:
window_result (
WindowAnalysisResult) – The analysis results being plotted.genotype (
str) – Genotype of the animal.channel_names (
list[str]) – List of channel names.n_channels (
int) – Number of channels.channel_abbrevs (
list[str]) – Abbreviated channel names for plotting.save_fig (
bool) – Whether to save figures to disk.save_path (
Path) – Directory where figures will be saved.
- __init__(war: WindowAnalysisResult, save_fig: bool = False, save_path: Path | None = None) None[source]#
- plot_coherecorr_matrix(groupby='animalday', bands=None, figsize=None, cmap='viridis', **kwargs)[source]#
- plot_linear_temporal(multiindex=['animalday', 'animal', 'genotype'], features: list[str] | None = None, channels: list[int] | None = None, figsize=None, score_type='z', show_endfile=False, **kwargs)[source]#
- plot_coherecorr_spectral(multiindex=['animalday', 'animal', 'genotype'], features: list[str] | None = None, figsize=None, score_type='z', cmap='bwr', triag=True, show_endfile=False, duration_name='duration', endfile_name='endfile', **kwargs)[source]#
- plot_psd_histogram(groupby='animalday', figsize=None, avg_channels=False, plot_type='loglog', plot_slope=True, xlim=None, **kwargs)[source]#
- plot_psd_spectrogram(multiindex=['animalday', 'animal', 'genotype'], freq_range=(1, 50), center_stat='mean', mode='z', figsize=None, cmap='magma', **kwargs)[source]#
- plot_temporal_heatmap(features: list[str] | str | None = None, figsize=None, cmap='viridis', score_type=None, norm=None, **kwargs)[source]#
Create temporal heatmap showing feature patterns over time.
Creates a heatmap where: - X-axis: Time of day (timestamp mod 24h) - Y-axis: Days - Color: Feature values (flattened across channels)
Parameters#
- featureslist[str], optional
List of features to plot. If None, uses non-band linear features.
- figsizetuple, optional
Figure size (width, height)
- cmapstr, optional
Colormap for the heatmap
- score_typestr, optional
Standardization method for feature values
- normmatplotlib.colors.Normalize, optional
Normalization object for the colormap. If None, uses default normalization. Common options: - matplotlib.colors.Normalize(vmin=0, vmax=1) # Fixed range - matplotlib.colors.CenteredNorm(vcenter=0) # Auto-detect range around 0 - matplotlib.colors.LogNorm() # Logarithmic scale
- **kwargs
Additional arguments passed to matplotlib