tomodrgn.analysis.scatter_annotate#
- scatter_annotate(x: ndarray, y: ndarray, centers_xy: ndarray | None = None, centers_ind: ndarray | None = None, annotate: bool = False, labels: list | None = None, alpha: float = 0.1, s: int = 1, **kwargs: Any) Tuple[Figure, Axes] [source]#
Create a scatter plot with optional annotations for each cluster center and corresponding label.
- Parameters:
x – array of x coordinates to plot
y – array of y coordinates to plot
centers_xy – optionally an array of x,y coordinates of cluster centers to superimpose, shape (nclusters, 2). Mutually exclusive with specifying centers_ind.
centers_ind – optionally an array indices indexing x and y as the cluster centers to superimpose, shape (nclusters). Mutually exclusive with specifying centers_xy.
annotate – whether to annotate the plot with text labels corresponding to each cluster center
labels – list of text labels for each cluster center
alpha – transparency of scatter points, passed to matplotlib.pyplot.scatter
s – size of scatter points, passed to matplotlib.pyplot.scatter
kwargs – additional keyword arguments passed to matplotlib.pyplot.scatter
- Returns:
matplotlib figure and axis