Skip to main content

plots.plot_features_distributions

plots.plot_features_distributions(df_features, x_list=None, title='')

Create a grid of histograms displaying the distribution of electrophysiological features.

This function generates a multi-panel figure with histograms for each feature in x_list. Each histogram is color-coded according to feature values and accompanied by a colorbar. The function uses quantile-based limits to handle outliers in the data visualization.

Args: df_features (pd.DataFrame): DataFrame containing the feature values with feature names as columns. x_list (list, optional): List of feature names to plot. If None, uses all available voltage features. Defaults to None. title (str, optional): Title for the figure. Defaults to ““.

Returns: tuple: A tuple containing: - fig (matplotlib.figure.Figure): The figure object containing all histograms. - axs (np.ndarray): Array of matplotlib.axes.Axes objects for each subplot.

Note: The function creates a 4x12 grid layout with histograms and colorbars. Each histogram uses quantile-based limits (0.1-0.9 for color range, 0.005-0.995 for histogram range) to handle outliers gracefully. The PuOr colormap is used for feature value coloring.