scanpy.plotting

Plotting API

Note

See the Settings section for all important plotting configurations.

Generic

pl.scatter(adata[, x, y, color, use_raw, …]) Scatter plot along observations or variables axes.
pl.heatmap(adata, var_names[, groupby, …]) Heatmap of the expression values of genes.
pl.dotplot(adata, var_names[, groupby, …]) Makes a dot plot of the expression values of var_names.
pl.violin(adata, keys[, groupby, log, …]) Violin plot.
pl.stacked_violin(adata, var_names[, …]) Stacked violin plots.
pl.matrixplot(adata, var_names[, groupby, …]) Creates a heatmap of the mean expression values per cluster of each var_names If groupby is not given, the matrixplot assumes that all data belongs to a single category.
pl.clustermap(adata[, obs_keys, use_raw, …]) Hierarchically-clustered heatmap.
pl.ranking(adata, attr, keys[, dictionary, …]) Plot rankings.

Preprocessing

Methods for visualizing quality control and results of preprocessing functions.

pl.highest_expr_genes(adata[, n_top, show, …]) Fraction of counts assigned to each gene over all cells.
pl.filter_genes_dispersion(result[, log, …]) Plot dispersions versus means for genes.
pl.highly_variable_genes(adata_or_result[, …]) Plot dispersions versus means for genes.

Tools

Methods that extract and visualize tool-specific annotation in an AnnData object. For any method in module tl, there is a method with the same name in pl.

PCA

pl.pca(adata, **kwargs) Scatter plot in PCA coordinates.
pl.pca_loadings(adata[, components, show, save]) Rank genes according to contributions to PCs.
pl.pca_variance_ratio(adata[, n_pcs, log, …]) Plot the variance ratio.
pl.pca_overview(adata, **params) Plot PCA results.

Embeddings

pl.tsne(adata, **kwargs) Scatter plot in tSNE basis.
pl.umap(adata, **kwargs) Scatter plot in UMAP basis.
pl.diffmap(adata, **kwargs) Scatter plot in Diffusion Map basis.
pl.draw_graph(adata[, layout]) Scatter plot in graph-drawing basis.

Branching trajectories and pseudotime, clustering

Visualize clusters using one of the embedding methods passing color='louvain'.

pl.dpt_groups_pseudotime(adata[, color_map, …]) Plot groups and pseudotime.
pl.dpt_timeseries(adata[, color_map, show, …]) Heatmap of pseudotime series.
pl.paga(adata[, threshold, color, layout, …]) Plot the PAGA graph through thresholding low-connectivity edges.
pl.paga_path(adata, nodes, keys[, use_raw, …]) Gene expression and annotation changes along paths in the abstracted graph.
pl.paga_compare(adata[, basis, edges, …]) Scatter and PAGA graph side-by-side.

Marker genes

pl.rank_genes_groups(adata[, groups, …]) Plot ranking of genes.
pl.rank_genes_groups_violin(adata[, groups, …]) Plot ranking of genes for all tested comparisons.
pl.rank_genes_groups_stacked_violin(adata[, …]) Plot ranking of genes using stacked_violin plot (see scanpy.api.pl.stacked_violin)
pl.rank_genes_groups_heatmap(adata[, …]) Plot ranking of genes using heatmap plot (see scanpy.api.pl.heatmap)
pl.rank_genes_groups_dotplot(adata[, …]) Plot ranking of genes using dotplot plot (see scanpy.api.pl.dotplot)
pl.rank_genes_groups_matrixplot(adata[, …]) Plot ranking of genes using matrixplot plot (see scanpy.api.pl.matrixplot)

Simulations

pl.sim(adata[, tmax_realization, …]) Plot results of simulation.