localvectordb.visualization.plots module
Static matplotlib plots for embedding visualisation.
- localvectordb.visualization._plots.plot_embedding_map(projection: EmbeddingProjection, color_by: List[str] | None = None, title: str = 'Document Embedding Map', save_path: str | Path | None = None, queries: List[QueryOverlay] | None = None, figsize: tuple = (10, 8), **kwargs) Figure
Scatter plot of projected document embeddings.
- Parameters:
projection (EmbeddingProjection) – Dimensionality-reduced coordinates.
color_by (list of str, optional) – Category labels for colouring each point.
title (str) – Plot title.
save_path (str or Path, optional) – If provided, save figure to this path.
queries (list of QueryOverlay, optional) – Query overlays to display on the map.
figsize (tuple) – Figure size.
- Return type:
matplotlib.figure.Figure
- localvectordb.visualization._plots.plot_similarity_matrix(sim_matrix: DocumentSimilarityMatrix, title: str = 'Document Similarity Matrix', save_path: str | Path | None = None, figsize: tuple | None = None, **kwargs) Figure
Heatmap of pairwise document similarities.
- Parameters:
sim_matrix (DocumentSimilarityMatrix) – Similarity matrix to plot.
title (str) – Plot title.
save_path (str or Path, optional) – Save path.
figsize (tuple, optional) – Figure size. Auto-scaled if
None.
- Return type:
matplotlib.figure.Figure
- localvectordb.visualization._plots.plot_clusters(projection: EmbeddingProjection, clusters: ClusterResult, title: str = 'Document Clusters', save_path: str | Path | None = None, figsize: tuple = (10, 8), **kwargs) Figure
Scatter plot of projected embeddings coloured by cluster.
- Parameters:
projection (EmbeddingProjection) – Dimensionality-reduced coordinates.
clusters (ClusterResult) – Cluster assignments.
title (str) – Plot title.
save_path (str or Path, optional) – Save path.
figsize (tuple) – Figure size.
- Return type:
matplotlib.figure.Figure