plots.figure_features_heatmap
plots.figure_features_heatmap(
tables,
pid,
channels=None,
feature_groups=None,
mean=None,
std=None,
mapping='Cosmos',
regions=None,
vmin=-2,
vmax=2,
cmap='RdBu_r',
show_histology=True,
show_colorbar=True,
show_group_labels=True,
show_feature_names=True,
fontsize=8,
title=None,
fig=None,
axs=None,
)Z-scored features of one probe against depth, beside its histology.
Each feature is z-scored over every channel of every probe of the first table, so the probe is compared with the whole dataset. Several tables (the aggregated and the denoised one, for example) are drawn side by side on that same scale.
Args: tables (pd.DataFrame or dict[str, pd.DataFrame]): Feature table(s) indexed by (pid, channel). A dict draws one panel per table, titled by its key. pid (str): The probe to draw. channels (pd.DataFrame, optional): Channel table indexed by (pid, channel) with axial_um, and {mapping}_id or an Allen atlas_id for the histology. Defaults to the first table, which then needs those columns. feature_groups (dict[str, list[str]] or list[str], optional): Features to draw, grouped by name, or a plain list. Defaults to the LF, CSD, AP and Spikes families of the feature schemas, restricted to the columns of the first table. Features missing from the first table are skipped with a warning. mean (pd.Series, optional): Per-feature mean of the z-score. Defaults to the mean over the first table. std (pd.Series, optional): Per-feature standard deviation of the z-score. Defaults to the standard deviation over the first table. mapping (str, optional): Region map of the histology. Defaults to “Cosmos”. regions (iblatlas.regions.BrainRegions, optional): Region table. Defaults to the iblatlas regions plus the decoders’ void_fluid. vmin (float, optional): Lower end of the colour range. Defaults to -2. vmax (float, optional): Upper end of the colour range. Defaults to 2. cmap (str, optional): Matplotlib colormap name. Defaults to “RdBu_r”. show_histology (bool, optional): Draw the histology bar. Defaults to True. show_colorbar (bool, optional): Draw the colorbar. Defaults to True. show_group_labels (bool, optional): Name the feature groups. Defaults to True. show_feature_names (bool, optional): Name each feature. Defaults to True. fontsize (float, optional): Font size of the feature names. Defaults to 8. title (str, optional): Figure title. fig (matplotlib.figure.Figure, optional): Figure of axs. axs (Sequence[matplotlib.axes.Axes], optional): One axes per panel, left to right: the histology (if shown), then one per table.
Returns: tuple: The figure, and a dict of axes keyed by panel: "histology", the table names ("features" for a single table) and "colorbar".