plot_states_overlaid_with_latents

behavenet.plotting.arhmm_utils.plot_states_overlaid_with_latents(latents, states, save_file=None, ax=None, xtick_locs=None, frame_rate=None, cmap='tab20b', format='png')[source]

Plot states for a single trial overlaid with latents.

Parameters:
  • latents (np.ndarray) – shape (n_frames, n_latents)

  • states (np.ndarray) – shape (n_frames,)

  • save_file (str, optional) – full save file (path and filename)

  • ax (matplotlib.Axes object or NoneType, optional) – axes to plot into; if NoneType, a new figure is created

  • xtick_locs (array-like, optional) – tick locations in bin values for plot

  • frame_rate (float, optional) – behavioral video framerate; to properly relabel xticks

  • cmap (str, optional) – matplotlib colormap

  • format (str, optional) – any accepted matplotlib save format, e.g. ‘png’ | ‘pdf’ | ‘jpeg’

Returns:

matplotlib figure handle if ax=None, otherwise updated axis

Return type:

matplotlib.figure.Figure