deepof.visuals.plot_gantt
- deepof.visuals.plot_gantt(coordinates: deepof_project, instance_id: str, supervised_annotations: deepof_table_dict | None = None, soft_counts: deepof_table_dict | None = None, bin_index: int | str | None = None, bin_size: int | str | None = None, precomputed_bins: ndarray | None = None, samples_max=20000, roi_number: int | None = None, animals_in_roi: list | None = None, roi_mode: str = 'mousewise', in_roi_criterion: str = 'Center', additional_checkpoints: DataFrame | None = None, signal_overlay: Series | None = None, instances_to_plot: list | None = None, ax: Any | None = None, save: bool = False)
Return a scatter plot of the passed projection. Allows for temporal and quality filtering, animal aggregation, and changepoint detection size visualization.
- Parameters:
coordinates (project) – deepOF project where the data is stored.
instance_id (str) – Name of the instance to display (can either be an experiment or a behavior).
supervised_annotations (table_dict) – table dict with supervised annotations per video. new figure will be created.
soft_counts (table_dict) – table dict with soft cluster assignments per animal experiment across time.
bin_index (Union[int,str]) – index of the bin of size bin_size to select along the time dimension. Denotes exact start position in the time domain if given as string.
bin_size (Union[int,str]) – bin size for time filtering.
precomputed_bins (np.ndarray) – precomputed time bins. If provided, bin_size and bin_index are ignored. Note: providing precomputed bins with gaps will result in an incorrect time vector depiction.
samples_max (int) – Maximum number of samples taken for plotting to avoid excessive computation times. If the number of rows in a data set exceeds this number the data is downsampled accordingly.
roi_number (int) – Number of the ROI that should be used for the plot (all behavior that occurs outside of the ROI gets excluded)
in_roi_criterion (str) – Criterion for in roi check, can be a single bodypart, a list of bodyparts or “all” bodyparts of a mouse
animals_in_roi (list) – List of ids of the animals that need to be inside of the active ROI. All frames in which any of the given animals are not inside of the ROI get excluded
roi_mode (str) – Determines how the rois should be applied to different behaviors. Options are “mousewise” (default, selected mice needs to be inside the ROI) and “behaviorwise” (only mice involved in a behavior need to be inside of the ROI)
additional_checkpoints (pd.DataFrame) – table with additional checkpoints to plot.
signal_overlay (pd.Series) – overlays a continuous signal with all selected behaviors. None by default.
instances_to_plot (list) – list of either behaviors or experiments to plot. If instance_id is an experiment this needs to be a list of behaviors and vice versa. If None, all options are plotted.
ax (plt.AxesSubplot) – axes where to plot the current figure. If not provided, new figure will be created.
save (bool) – Saves a time-stamped vectorized version of the figure if True.