deepof.visuals.plot_heatmaps
- deepof.visuals.plot_heatmaps(coordinates: deepof_coordinates, bodyparts: list, center: str = 'arena', align: str | None = None, exp_condition: str | None = None, condition_value: str | None = None, experiment_id: int = 'average', bin_size: int | str | None = None, bin_index: int | str | None = None, precomputed_bins: ndarray | None = None, samples_max: int = 20000, roi_number: int | None = None, animals_in_roi: list | None = None, display_rois: bool = True, in_roi_criterion: str = 'Center', display_arena: bool = True, xlim: float | None = None, ylim: float | None = None, extrapolate_heatmap: bool = True, save: bool = False, dpi: int = 100, ax: Any | None = None, show: bool = True, **kwargs) figure
Plot heatmaps of the specified body parts (bodyparts) of the specified animal (i).
- Parameters:
coordinates (coordinates) – deepof Coordinates object.
bodyparts (list) – list of body parts to plot.
center (str) – Name of the body part to which the positions will be centered. If false, the raw data is returned; if ‘arena’ (default), coordinates are centered in the pitch.
align (str) – Selects the body part to which later processes will align the frames with (see preprocess in table_dict documentation).
exp_condition (str) – Experimental condition to plot base filters on.
condition_value (str) – Experimental condition value to plot. If available, it filters the experiments to keep only those whose condition value matches the given string in the provided exp_condition.
experiment_id (str) – Name of the experiment to display. When given as “average” positiosn of all animals are averaged.
bin_size (Union[int,str]) – bin size for time filtering.
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.
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
display_rois (bool) – Display the active ROI, if a ROI was selected. Defaults to True.
display_arena (bool) – whether to plot a dashed line with an overlying arena perimeter. Defaults to True.
xlim (float) – x-axis limits.
ylim (float) – y-axis limits.
extrapolate_heatmap (bool) – show full heatmap including extrapolated parts (default=True)
save (str) – if provided, the figure is saved to the specified path.
dpi (int) – resolution of the figure.
ax (plt.AxesSubplot) – axes where to plot the current figure. If not provided, a new figure will be created.
show (bool) – whether to show the created figure. If False, returns al axes.
kwargs – additional arguments to pass to the seaborn kdeplot function.
- Returns:
figure with the specified characteristics
- Return type:
heatmaps (plt.figure)