plot#
API pages include interactive (HTML) plots that would possibly not render correctly on a mobile device.
- plot(data: AnnData | MuData, mapping: FeatureSpec | None = None, *, axis: Literal[0, 1] | None = None, variable_keys: Sequence[str] | None = None, observation_id_column: str = 'Barcode', variable_id_column: str = 'Variable', include_dimensions: bool | int = False) PlotSpec#
Base plot (for plots without data wrangling).
- Parameters:
data (
AnnData | MuData) – The single-cell data object.mapping (
FeatureSpec | None, defaultNone) – Aesthetic mappings for the plot, the result of aes().axis (
{0,1}| None, defaultNone) – axis of the data, 0 for observations and 1 for variables.variable_keys (
Sequence[str] | None, defaultNone) – Variable keys to add to the DataFrame. If None, no additional keys are added.observation_id_column (
str, default'Barcode') – The name of the observations column.variable_id_column (
str, default'Variable') – Name for the variables index column.include_dimensions (
bool | int, defaultFalse) – Whether to include dimensions in the DataFrame. Providing an integer will limit the number of dimensions to given number.
- Returns:
PlotSpec– Base ggplot object.- Raises:
UnsupportedDataTypeError – If data is not a supported single-cell data object.
Examples
from ggrust import * import cellestial as cl import scanpy as sc data = cl.datasets.pbmc3k() p1 = ( cl.plot(data, aes(x='cell_type_lvl1', y='n_genes')) ) p1 # plot object without layers
from ggrust import * import cellestial as cl import scanpy as sc data = cl.datasets.pbmc3k() p2 = ( cl.plot(data, aes(x='cell_type_lvl1', y='n_genes')) + geom_violin(aes(fill='cell_type_lvl1'), scale='width') + geom_boxplot(width=0.2,outlier_size=0) + scale_fill_viridis() ) p2