tomodrgn.analysis.scatter_color#
- scatter_color(x: ndarray, y: ndarray, c: ndarray, cmap: str = 'viridis', s: int = 1, alpha: float = 0.1, cbar_label: str | None = None, **kwargs: Any) Tuple[Figure, Axes] [source]#
Create a scatter plot colored by auto-mapped values of c according to specified cmap, and plot a corresponding colorbar.
- Parameters:
x – array of x coordinates to plot
y – array of y coordinates to plot
c – array of values by which to map color of each xy point
cmap – the matplotlib colormap from which to sample colors. See: https://matplotlib.org/stable/users/explain/colors/colormaps.html#classes-of-colormaps
s – size of scatter points, passed to matplotlib.pyplot.scatter
alpha – transparency of scatter points, passed to matplotlib.pyplot.scatter
cbar_label – optional text to label the colorbar
kwargs – additional keyword arguments passed to matplotlib.pyplot.scatter
- Returns:
matplotlib figure and axis