emperor.Emperor.opacity_by¶
- 
Emperor.opacity_by(category, opacities=None, global_scale=1.0, scaled=False)¶ Set the scaling settings for the plot elements
Parameters: category: str
Name of the metadata column.
opacities: dict or pd.Series, optional
Mapping of categories to numbers determining the opacity 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
opacitiesshould be assumed to be numeric and scaled in size according to their value.Returns: emperor.Emperor
Emperor object with updated settings.
Raises: KeyError
If
categoryis not part of the metadata.TypeError
If
categoryis not a string. Ifglobal_scaleis not a number. Ifscaledis not a boolean value.ValueError
If
opacitiesdescribes fewer or more categories than the ones present in thecategorycolumn. Ifopacitieshas 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.scale_by,emperor.core.Emperor.set_background_color,emperor.core.Emperor.set_axes