pairot.pl.distance#
- pairot.pl.distance(data, width=None, height=None, backend='plotly')#
Plot cluster distances from
pairot.tl.DatasetMap.compute_distance.- Parameters:
data (
DataFrame) – pd.DataFrame containing the cluster distances.width (
int|None(default:None)) – Width of the plot in pixels.height (
int|None(default:None)) – Height of the plot in pixels.backend (
Literal['plotly','matplotlib'] (default:'plotly')) – Backend to use for plotting. Options are ‘plotly’ and ‘matplotlib’. The plotly backend allows for interactive plots, while the matplotlib backend is suitable for static plots.
Examples
>>> import pairot as pr >>> >>> # Get cluster mappings between query and reference dataset >>> mapping = dataset_map.compute_mapping() >>> # Get cluster distances between query and reference dataset >>> distance = dataset_map.compute_distance() >>> distance = distance.loc[ >>> mapping.max(axis=1).sort_values(ascending=False).index.tolist(), >>> mapping.max().sort_values(ascending=False).index.tolist(), >>> ] # order cluster distance matrix the same way as similarity matrix >>> pr.pl.distance(distance)