plot_means_and_histos#
- RAPDOR.plots.plot_means_and_histos(rapdorids, rapdordata: RAPDORData, colors, title_col: str = None, **kwargs)#
Combines mean distribution plots and histograms into a single figure with subplots.
This function generates a vertically stacked composite figure containing: 1. Mean expression distributions, 2. A histogram of mean distances, 3. A histogram of a variability measure (e.g., ANOSIM R).
- Parameters:
rapdorids (iterable) – A list or set of RAPDOR IDs for which data will be plotted.
rapdordata (RAPDORData) – A RAPDORData object that contains: - df: A pandas DataFrame with PCA and metric data. - state.distance_method: A string for labeling the distance histogram.
colors (list or tuple) – A sequence of color values. The first is used for the distance histogram, the second for the variability histogram, and passed into mean plotting.
title_col (str, optional) – Name of the column in rapdordata.df used for labeling mean distribution plots.
**kwargs –
Additional keyword arguments passed to make_subplots, such as: - row_heights (list of float): Heights for the three subplot rows.
Defaults to [0.5, 0.25, 0.25].
vertical_spacing (float): Spacing between subplot rows. Defaults to 0.1.
- Returns:
A Plotly figure object with three vertically stacked subplots.
- Return type:
plotly.graph_objects.Figure
Example
fig = plot_means_and_histos([“P12345”, “P67890”], rapdordata, colors=[“#1f77b4”, “#ff7f0e”]) fig.show()