tropea_clustering.plot_smooth.plot_sankey¶
- tropea_clustering.plot_smooth.plot_sankey(title, labels, tmp_frame_list)[source]¶
Plots the Sankey diagram at the desired frames.
Warning
This function requires the python package Kaleido, and uses plotly instead of matplotlib.pyplot. For this reason is deprecated and not supported since tropea-clustering 2.0.0.
- Parameters:
title (pathlib.Path) – The path of the .png file the figure will be saved as.
labels (ndarray of shape (n_particles, n_frames)) – The output of the clustering algorithm.
tmp_frame_list (list[int] | NDArray[np.int64]) – The list of frames at which we want to plot the Sankey.
Example
Here’s an example of the output:
For each of the selected frames, the colored bars width is proportional to each cluster population. The gray bands’ witdh are proportional to the number of data points moving from one cluster to the other between the selected frames. State “-1” refers to the unclassified data.