tomodrgn.analysis.plot_by_cluster_subplot#

plot_by_cluster_subplot(x: ndarray, y: ndarray, labels_sel: int | ndarray[int], labels: ndarray, s: int = 2, alpha: float = 0.1, cmap: str | None = None, **kwargs) Tuple[Figure, Axes][source]#

Plot all points x,y with colors per class labels on individual subplots for each of labels_sel.

Parameters:
  • x – array of x coordinates to plot, shape (nptcls)

  • y – array of y coordinates to plot, shape (nptcls)

  • labels – array of cluster labels for each particle, shape (nptcls)

  • labels_sel – selected cluster labels to plot. If int, plot all classes matching label in range(labels_sel). If array of int, plot all classes matching label in labels_sel.

  • s – size of scatter points, passed to matplotlib.pyplot.scatter

  • alpha – transparency of scatter points, passed to matplotlib.pyplot.scatter

  • cmap – the matplotlib colormap from which to sample colors. See: https://matplotlib.org/stable/users/explain/colors/colormaps.html#classes-of-colormaps

  • kwargs – additional keyword arguments passed to matplotlib.pyplot.scatter

Returns:

matplotlib figure and axes