voyagerpy.plotting.plot_expression#

voyagerpy.plotting.plot_expression(adata: AnnData, gene: str | Sequence[str], y: str | None = None, obsm: str | None = None, ax: None | Axes | ndarray[Any, dtype[Axes]] = None, **kwargs) Axes | ndarray[Any, dtype[Axes]]#

Plot expression of genes in adata.

If y is not None, then the expression of the gene(s) is plotted against the values in adata.obs[y], resulting in a scatter plot using plot_expression_scatter. Otherwise, the genes are plotted as violin plots using plot_expression_violin.

Parameters:
  • adata (AnnData) – Annotated data matrix.

  • gene (Union[str, Sequence[str]]) – The gene(s) to plot.

  • y (Optional[str], optional) – The column name of the value on the y-axis to plos, by default None.

  • obsm (Optional[str], optional) – The name of the obsm dataframe to use for plotting. If None, then obs is used, by default None.

  • ax (Union[None, Axes, npt.NDArray[Axes]], optional) – The axes to draw on. If None, new axes will be created, by default None.

  • **kwargs – Keyword arguments passed to the corresponding plotting function.

Returns:

The Axes object or array of Axes objects that were drawn on.

Return type:

Union[Axes, npt.NDArray[Axes]]

See also

plot_expression_violin(), plot_expression_scatter()