emperor.Emperor.shape_by

Emperor.shape_by(category, shapes=None)

Set the shape settings for the plot elements

Parameters:

category: str

Name of the metadata column.

shapes: dict or pd.Series, optional

Mapping of categories to string values determining the shape of the objects. See the notes for the valid options.

Returns:

emperor.Emperor

Emperor object with updated settings.

Raises:

KeyError

If category is not part of the metadata.

TypeError

If category is not a string.

ValueError

If shapes describes fewer or more categories than the ones present in the category column. If shapes has shapes in a non-string format.

See also

emperor.core.Emperor.color_by, emperor.core.Emperor.scale_by, emperor.core.Emperor.opacity_by, emperor.core.Emperor.visibility_by, emperor.core.Emperor.set_background_color, emperor.core.Emperor.set_axes

Notes

The valid shape names are "Sphere", "Cube", "Cone", "Icosahedron" and "Cylinder".