emperor.Emperor.scale_by

Emperor.scale_by(category, scales=None, global_scale=1.0, scaled=False)

Set the scaling settings for the plot elements

Parameters:

category: str

Name of the metadata column.

scales: dict or pd.Series, optional

Mapping of categories to numbers determining the size of the elements in each category.

global_scale: int or float, optional

The size of all the elements.

scaled: bool

Whether or not the values in scales should be assumed to be numeric and scaled in size according to their value.

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. If global_scale is not a number. If scaled is not a boolean value.

ValueError

If scales describes fewer or more categories than the ones present in the category column. If scales has sizes in a non-numeric format.

See also

emperor.core.Emperor.visibility_by, emperor.core.Emperor.color_by, emperor.core.Emperor.shape_by, emperor.core.Emperor.set_background_color, emperor.core.Emperor.set_axes