larvaworld.lib.plot.time

Timeseries plotting

Functions

plot_ethogram(→ Any)

Create ethogram showing behavioral bouts over time.

plot_nengo_network(→ Any)

Plot Nengo neural network probe outputs over time.

timeplot(, **kwargs)

Create time series plot for one or more parameters.

timeplots(→ Any)

Create multi-panel time series plots.

plot_navigation_index(→ Any)

Plot navigation index time series.

plot_pathlength(→ Any)

Plot cumulative path length over time.

plot_dispersal(, scaled, **kwargs)

Plot dispersal metric over time.

Module Contents

larvaworld.lib.plot.time.plot_ethogram(subfolder: str = 'timeplots', **kwargs: Any) Any

Create ethogram showing behavioral bouts over time.

Generates dual-panel time series showing runs/pauses and left/right turns as colored horizontal bars representing behavioral epochs.

Args:

subfolder: Subfolder for saving. Defaults to ‘timeplots’ **kwargs: Additional arguments passed to AutoPlot

Returns:

Plot output (figure object or None based on return_fig setting)

Example:
>>> fig = plot_ethogram(datasets=[d1, d2])
larvaworld.lib.plot.time.plot_nengo_network(datasets: Sequence[Any], group: str | None = None, probes: Sequence[str] | None = None, same_plot: bool = False, subfolder: str = 'nengo', **kwargs: Any) Any

Plot Nengo neural network probe outputs over time.

Creates multi-panel time series showing neural network activity from Nengo probes for different modules (crawler, turner, feeder, etc.).

Args:

datasets: List of datasets with Nengo probe data group: Probe group name (‘anemotaxis’, ‘frequency’, etc.). Required if probes is None probes: Individual probe names. Uses group probes if None same_plot: Plot all probes on same axis. Defaults to False subfolder: Subfolder for saving. Defaults to ‘nengo’ **kwargs: Additional arguments passed to AutoPlot

Returns:

Plot output (figure object or None based on return_fig setting)

Example:
>>> fig = plot_nengo_network(datasets=[d1], group='anemotaxis', same_plot=True)
larvaworld.lib.plot.time.timeplot(ks: Sequence[str] = [], pars: Sequence[str] = [], name: str | None = None, same_plot: bool = True, individuals: bool = False, table: Any | None = None, unit: str = 'sec', absolute: bool = True, show_legend: bool = True, show_first: bool = False, subfolder: str = 'timeplots', legend_loc: str = 'upper left', leg_fontsize: int = 15, figsize: Tuple[float, float] = (7.5, 5), **kwargs: Any) Any

Create time series plot for one or more parameters.

Generates single-panel time series with quantile bands showing parameter evolution over time, with optional individual trajectories.

Args:

ks: Parameter shortcut keys. Required if pars is empty pars: Direct parameter names. Uses ks if empty name: Plot name for saving. Auto-generated if None same_plot: Plot all parameters on same axes. Defaults to True individuals: Show individual trajectories. Defaults to False table: Table data for custom x-axis. Defaults to None unit: Time unit (‘sec’, ‘min’, ‘hour’). Defaults to ‘sec’ absolute: Use absolute values. Defaults to True show_legend: Show dataset legend. Defaults to True show_first: Highlight first individual. Defaults to False subfolder: Subfolder for saving. Defaults to ‘timeplots’ legend_loc: Legend location. Defaults to ‘upper left’ leg_fontsize: Legend font size. Defaults to 15 figsize: Figure size. Defaults to (7.5, 5) **kwargs: Additional arguments passed to AutoPlot

Returns:

Plot output (figure object or None based on return_fig setting)

Example:
>>> fig = timeplot(ks=['v', 'fov'], datasets=[d1, d2], individuals=True)
larvaworld.lib.plot.time.timeplots(ks: Sequence[str], subfolder: str = 'timeplots', name: str | None = None, unit: str = 'sec', xlim: Sequence[float] | None = None, individuals: bool = False, absolute: bool = False, show_first: bool = False, **kwargs: Any) Any

Create multi-panel time series plots.

Generates stacked time series panels (one per parameter) showing quantile bands for multiple parameters over time.

Args:

ks: Parameter shortcut keys to plot subfolder: Subfolder for saving. Defaults to ‘timeplots’ name: Plot name for saving. Auto-generated if None unit: Time unit (‘sec’, ‘min’, ‘hour’). Defaults to ‘sec’ xlim: X-axis limits. Defaults to None individuals: Show individual trajectories. Defaults to False absolute: Use absolute values. Defaults to False show_first: Highlight first individual. Defaults to False **kwargs: Additional arguments passed to AutoPlot

Returns:

Plot output (figure object or None based on return_fig setting)

Example:
>>> fig = timeplots(ks=['v', 'fov', 'b'], datasets=[d1, d2], unit='min')
larvaworld.lib.plot.time.plot_navigation_index(subfolder: str = 'source', **kwargs: Any) Any

Plot navigation index time series.

Creates time series showing navigation efficiency index over time, measuring directed movement toward source/target.

Args:

subfolder: Subfolder for saving. Defaults to ‘source’ **kwargs: Additional arguments passed to AutoPlot

Returns:

Plot output (figure object or None based on return_fig setting)

Example:
>>> fig = plot_navigation_index(datasets=[d1, d2])
larvaworld.lib.plot.time.plot_pathlength(scaled: bool = False, **kwargs: Any) Any

Plot cumulative path length over time.

Creates time series showing total distance traveled (scaled or absolute) accumulated over the experiment duration.

Args:

scaled: Use body-length-scaled distance. Defaults to False **kwargs: Additional arguments passed to timeplots

Returns:

Plot output (figure object or None based on return_fig setting)

Example:
>>> fig = plot_pathlength(datasets=[d1, d2], scaled=True)
larvaworld.lib.plot.time.plot_dispersal(range: Tuple[int, int] = (0, 40), scaled: bool = False, **kwargs: Any) Any

Plot dispersal metric over time.

Creates time series showing spatial dispersal from origin over specified time range (scaled or absolute distance).

Args:

range: Time range (start, end) in minutes. Defaults to (0, 40) scaled: Use body-length-scaled distance. Defaults to False **kwargs: Additional arguments passed to timeplots

Returns:

Plot output (figure object or None based on return_fig setting)

Example:
>>> fig = plot_dispersal(datasets=[d1, d2], range=(0, 60), scaled=True)