larvaworld.lib.plot.hist ======================== .. py:module:: larvaworld.lib.plot.hist .. autoapi-nested-parse:: Histograms Functions --------- .. autoapisummary:: larvaworld.lib.plot.hist.module_endpoint_hists larvaworld.lib.plot.hist.plot_ang_pars larvaworld.lib.plot.hist.plot_distros larvaworld.lib.plot.hist.plot_crawl_pars larvaworld.lib.plot.hist.plot_turn_amp_VS_Ypos larvaworld.lib.plot.hist.plot_turn_duration larvaworld.lib.plot.hist.plot_bout_ang_pars larvaworld.lib.plot.hist.plot_endpoint_scatter larvaworld.lib.plot.hist.plot_turns larvaworld.lib.plot.hist.plot_endpoint_hist larvaworld.lib.plot.hist.plot_endpoint_box larvaworld.lib.plot.hist.plot_endpoint_params Module Contents --------------- .. py:function:: module_endpoint_hists(e: Any, mkey: str = 'crawler', mode: str = 'realistic', Nbins: Optional[int] = None, show_median: bool = True, **kwargs: Any) -> Any Create histograms of module endpoint parameters. Generates multi-panel histogram figure showing distribution of module parameters at experiment endpoints, useful for model configuration analysis. Args: e: Endpoint data containing parameter values mkey: Module key identifier. Defaults to 'crawler' mode: Parameter mode ('realistic', etc.). Defaults to 'realistic' Nbins: Number of histogram bins. Auto-calculated if None show_median: Whether to show median line. Defaults to True **kwargs: Additional arguments passed to AutoBasePlot Returns: Plot output (figure object or None based on return_fig setting) Example: >>> fig = module_endpoint_hists(endpoint_data, mkey='crawler', Nbins=20) .. py:function:: plot_ang_pars(absolute: bool = False, rad2deg: bool = True, include_rear: bool = False, name: str = 'ang_pars', half_circles: bool = True, kde: bool = True, Npars: int = 5, Nbins: int = 100, **kwargs: Any) -> Any Create histograms of angular parameters. Generates multi-panel histograms showing distributions of bend, angular velocity, angular acceleration, and optionally rear body angles. Args: absolute: Use absolute values. Defaults to False rad2deg: Convert radians to degrees. Defaults to True include_rear: Include rear body parameters. Defaults to False name: Plot name for saving. Defaults to 'ang_pars' half_circles: Use half-circle plots. Defaults to True kde: Include kernel density estimate. Defaults to True Npars: Number of parameters (3 or 5). Defaults to 5 Nbins: Number of histogram bins. Defaults to 100 **kwargs: Additional arguments passed to plot_step_params Returns: Plot output (figure object or None based on return_fig setting) Example: >>> fig = plot_ang_pars(datasets=[d1, d2], include_rear=True, Npars=5) .. py:function:: plot_distros(name: Optional[str] = None, ks: Sequence[str] = ('v', 'a', 'sv', 'sa', 'b', 'bv', 'ba', 'fov', 'foa'), mode: str = 'hist', half_circles: bool = True, annotation: bool = False, target_only: Optional[str] = None, show_ns: bool = False, subfolder: str = 'distro', Nbins: int = 100, **kwargs: Any) -> Any Create distribution plots for kinematic parameters. Generates multi-panel histograms or boxplots showing distributions of velocity, acceleration, and angular parameters across datasets. Args: name: Plot name for saving. Auto-generated if None ks: Parameter keys to plot. Defaults to velocity and angular parameters mode: Plot type ('hist' or 'box'). Defaults to 'hist' half_circles: Use half-circle layout. Defaults to True annotation: Add statistical annotations. Defaults to False target_only: Compare only to target dataset. Defaults to None show_ns: Show non-significant comparisons. Defaults to False subfolder: Subfolder for saving. Defaults to 'distro' Nbins: Number of histogram bins. Defaults to 100 **kwargs: Additional arguments passed to AutoPlot Returns: Plot output (figure object or None based on return_fig setting) Example: >>> fig = plot_distros(datasets=[d1, d2], mode='hist', ks=['v', 'a', 'fov']) .. py:function:: plot_crawl_pars(kde: bool = True, **kwargs: Any) -> Any Create histograms of crawling parameters. Generates histograms for stride count, run duration, and cumulative distance - key metrics for crawling locomotion analysis. Args: kde: Include kernel density estimate. Defaults to True **kwargs: Additional arguments passed to plot_endpoint_params Returns: Plot output (figure object or None based on return_fig setting) Example: >>> fig = plot_crawl_pars(datasets=[d1, d2], kde=True) .. py:function:: plot_turn_amp_VS_Ypos(**kwargs: Any) -> Any Plot turn amplitude as function of Y position. Creates histogram showing distribution of body Y-position during turns, useful for analyzing body curvature patterns. Args: **kwargs: Additional arguments passed to plot_turn_amp Returns: Plot output (figure object or None based on return_fig setting) Example: >>> fig = plot_turn_amp_VS_Ypos(datasets=[d1, d2]) .. py:function:: plot_turn_duration(absolute: bool = True, **kwargs: Any) -> Any Plot turn duration distribution. Creates histogram showing distribution of turn durations across datasets. Args: absolute: Use absolute durations. Defaults to True **kwargs: Additional arguments passed to plot_turn_amp Returns: Plot output (figure object or None based on return_fig setting) Example: >>> fig = plot_turn_duration(datasets=[d1, d2], absolute=True) .. py:function:: plot_bout_ang_pars(name: str = 'bout_ang_pars', absolute: bool = True, include_rear: bool = True, subfolder: str = 'turn', **kwargs: Any) -> Any Plot angular parameters during behavioral bouts. Creates histograms of angular velocity and acceleration for front and optionally rear body segments during runs vs pauses. Args: name: Plot name for saving. Defaults to 'bout_ang_pars' absolute: Use absolute values. Defaults to True include_rear: Include rear body parameters. Defaults to True subfolder: Subfolder for saving. Defaults to 'turn' **kwargs: Additional arguments passed to AutoPlot Returns: Plot output (figure object or None based on return_fig setting) Example: >>> fig = plot_bout_ang_pars(datasets=[d1, d2], include_rear=True) .. py:function:: plot_endpoint_scatter(subfolder: str = 'endpoint', ks: Sequence[str] | None = None, **kwargs: Any) -> Any Create scatter plots of endpoint parameter pairs. Generates pairwise scatter plots showing correlations between endpoint parameters across datasets. Args: subfolder: Subfolder for saving. Defaults to 'endpoint' ks: Parameter keys to plot. Required **kwargs: Additional arguments passed to AutoPlot Returns: Plot output (figure object or None based on return_fig setting) Example: >>> fig = plot_endpoint_scatter(datasets=[d1, d2], ks=['cum_sd', 'run_tr', 'pau_tr']) .. py:function:: plot_turns(name: str = 'turn_amplitude', absolute: bool = False, subfolder: str = 'turn', **kwargs: Any) -> Any Plot turn amplitude distribution. Creates violin plots showing distribution of turn amplitudes (bearing changes) during turns across datasets. Args: name: Plot name for saving. Defaults to 'turn_amplitude' absolute: Use absolute amplitudes. Defaults to False subfolder: Subfolder for saving. Defaults to 'turn' **kwargs: Additional arguments passed to AutoPlot Returns: Plot output (figure object or None based on return_fig setting) Example: >>> fig = plot_turns(datasets=[d1, d2], absolute=False) .. py:function:: plot_endpoint_hist(**kwargs: Any) -> Any Create histograms of endpoint parameters. Wrapper function that generates histogram plots for experiment endpoint metrics across datasets. Args: **kwargs: Arguments passed to plot_endpoint_params Returns: Plot output (figure object or None based on return_fig setting) Example: >>> fig = plot_endpoint_hist(datasets=[d1, d2], ks=['cum_sd', 'run_tr']) .. py:function:: plot_endpoint_box(**kwargs: Any) -> Any Create boxplots of endpoint parameters. Wrapper function that generates boxplot comparisons for experiment endpoint metrics across datasets. Args: **kwargs: Arguments passed to plot_endpoint_params Returns: Plot output (figure object or None based on return_fig setting) Example: >>> fig = plot_endpoint_box(datasets=[d1, d2], ks=['cum_sd', 'run_tr']) .. py:function:: plot_endpoint_params(type: str, mode: str = 'basic', **kwargs: Any) -> Any Create plots of endpoint parameters with specified type. General function for plotting endpoint parameters using different visualization types (histogram, boxplot, etc.). Args: type: Plot type ('hist', 'box', etc.) mode: Parameter mode. Defaults to 'basic' **kwargs: Additional arguments passed to plot_params Returns: Plot output (figure object or None based on return_fig setting) Example: >>> fig = plot_endpoint_params(type='hist', datasets=[d1, d2], ks=['cum_sd'])