plot_csds
go-to Plot centroid-distance cavity histograms (CSD) stored on RAG nodes after add_csd_to_rag_with_pbc.
visualize.plot_csds(
rag,
pbc_groups,
cscale=None,
no_pbc=False,
cluster_key='cluster',
)Plot cavity size distributions (CSD) stored on the RAG.
Each trace is the histogram of distance from the PBC-aware pocket centroid to void voxels (csd_x_pbc / csd_y_pbc), typically from :func:mofography.compute.add_csd_to_rag_with_pbc.
This is not the Rust pocketwise probe PSD (use :func:compute_psds_pocketwise_rust or :func:plot_pocket_psds_from_grid). For energy histograms along sampling paths, use :func:plot_vdw_hists after :func:mofography.compute.add_vdw_hist_to_rag.
Parameters
rag : networkx.Graph Region adjacency graph with CSD node attributes. pbc_groups : list Sets of region nodes merged by periodic boundary conditions. cscale : colorscale, optional Plotly qualitative or sequential colorscale for cluster_key colors. no_pbc : bool If True, plot per-node csd_x / csd_y instead of PBC groups. cluster_key : str Node attribute used only for line color (e.g. cluster_geom_pbc).
Returns
list Plotly Scatter traces (one per region or PBC group).