spateo.plotting.static.colorlabel#

Module Contents#

Functions#

color_label(adata[, basis, color_key, dpi, ...])

Color the segmented cells with different colors.

Attributes#

spateo.plotting.static.colorlabel.DEFAULT_COLORS = ('red', 'blue', 'yellow', 'magenta', 'green', 'indigo', 'darkorange', 'cyan', 'pink', 'yellowgreen')[source]#
spateo.plotting.static.colorlabel.color_label(adata: anndata.AnnData, basis='contour', color_key: list | None = None, dpi: int = 100, boundary_width: float = 0.2, boundary_color='black', figsize=(6, 6), aspect: str = 'equal', *args, **kwargs)[source]#

Color the segmented cells with different colors.

Parameters:
adata

~anndata.AnnData An Annodata object.

basis

str The key to the column in the adata.obs, from which the contour of the cell segmentation will be generated.

color_key

list List of colors. If the number of labels exceeds the number of colors, then the colors are cycled.

dpi

float, (default: 100.0) The resolution of the figure in dots-per-inch. Dots per inches (dpi) determines how many pixels the figure comprises. dpi is different from ppi or points per inches. Note that most elements like lines, markers, texts have a size given in points so you can convert the points to inches. Matplotlib figures use Points per inch (ppi) of 72. A line with thickness 1 point will be 1./72. inch wide. A text with fontsize 12 points will be 12./72. inch height. Of course if you change the figure size in inches, points will not change, so a larger figure in inches still has the same size of the elements.Changing the figure size is thus like taking a piece of paper of a different size. Doing so, would of course not change the width of the line drawn with the same pen. On the other hand, changing the dpi scales those elements. At 72 dpi, a line of 1 point size is one pixel strong. At 144 dpi, this line is 2 pixels strong. A larger dpi will therefore act like a magnifying glass. All elements are scaled by the magnifying power of the lens. see more details at answer 2 by @ImportanceOfBeingErnest: https://stackoverflow.com/questions/47633546/relationship-between-dpi-and-figure-size

boundary_width

float, (default: 0.2) The line width of boundary.

boundary_color

(default: “black”) The color value of boundary.

figsize

tuple The size of the figure in inches.

aspect

str Set the aspect of the axis scaling, i.e. the ratio of y-unit to x-unit. In physical spatial plot, the default is ‘equal’. See more details at: https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.set_aspect.html

spateo.plotting.static.colorlabel.bright_10 = ['#9d00fe', '#0000ff', '#ff0000', '#21b20c', '#f2e50b', '#6e260e', '#cd7f32', '#ff7518',...[source]#
spateo.plotting.static.colorlabel.vega_10[source]#
spateo.plotting.static.colorlabel.vega_10_scanpy[source]#
spateo.plotting.static.colorlabel.vega_20[source]#
spateo.plotting.static.colorlabel.vega_20_scanpy[source]#
spateo.plotting.static.colorlabel.default_20[source]#
spateo.plotting.static.colorlabel.zeileis_28 = ['#023fa5', '#7d87b9', '#bec1d4', '#d6bcc0', '#bb7784', '#8e063b', '#4a6fe3', '#8595e1',...[source]#
spateo.plotting.static.colorlabel.default_28[source]#
spateo.plotting.static.colorlabel.godsnot_102 = ['#FFFF00', '#1CE6FF', '#FF34FF', '#FF4A46', '#008941', '#006FA6', '#A30059', '#FFDBE5',...[source]#
spateo.plotting.static.colorlabel.interaction_colors = ['#FF0000', '#FF69B4', '#FFF68F', '#FF8C00', '#C71585', '#00CED1', '#1874CD', '#8B4726',...[source]#