Skip to main content

plots.plot_cumulative_probas

plots.plot_cumulative_probas(
    probas,
    depths,
    aids,
    regions=None,
    ax=None,
    legend=False,
)

Plot cumulative probabilities of brain regions along probe depths.

Creates a stacked area plot showing the probability distribution of different brain regions at each depth along a probe trajectory. Each region is colored according to its standard atlas color.

Args: probas (np.ndarray): Array of shape (ndepths, nregions) containing probabilities for each region at each depth. Values should sum to 1 across regions for each depth. depths (np.ndarray): Vector of length ndepths containing the depth values along the probe trajectory. aids (np.ndarray): Vector of length nregions containing the atlas IDs for each region. regions (iblatlas.BrainRegions, optional): BrainRegions object containing region information. If None, a new instance is created. ax (matplotlib.axes.Axes, optional): Axes on which to plot. If None, the current axes will be used. legend (bool, optional): Whether to display a legend with region names. Defaults to False.

Returns: matplotlib.axes.Axes: The axes object containing the plot.

Note: The function creates a stacked area plot where each brain region is represented by a different color from the atlas. The y-axis represents depth along the probe.