tomodrgn.analysis.scatter_annotate_hex#

scatter_annotate_hex(x: ndarray, y: ndarray, centers_xy: ndarray | None = None, centers_ind: ndarray | None = None, annotate: bool = False, labels: list | None = None, **kwargs: Any) FacetGrid[source]#

Create a hexbin 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

  • kwargs – additional keyword arguments passed to seaborn.jointplot

Returns:

matplotlib figure