cassiopeia.pl.labels_from_coordinates#

cassiopeia.pl.labels_from_coordinates(tree, attribute_key='spatial', shape=(1000, 1000))[source]#

Create a (synthetic) labels Numpy array for use with 3D plotting.

Cells are represented as circles with a radius scaled by the square root of the number of cells. The center of each circle is the cell’s spatial coordinates.

Parameters:
tree CassiopeiaTree

CassiopieaTree to generate labels for

attribute_key str (default: 'spatial')

Attribute name in the cell_meta of the tree containing coordinates. All columns of the form {attribute_key}_i where i is an integer 0… will be used.

shape tuple (default: (1000, 1000))

Shape of the array to generate. This should be a tuple of two integers, representing the height and width of the array.

Return type:

ndarray

Returns:

A synthetic labels array that can be used for 3D plotting.

Raises:

PlottingError if there are not exactly two spatial coordinates.