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, …])

../_images/scanpy.pl.heatmap.png

pl.dotplot(adata, var_names[, groupby, …])

../_images/scanpy.pl.dotplot.png

pl.tracksplot(adata, var_names, groupby[, …])

In this type of plot each var_name is plotted as a filled line plot where the y values correspond to the var_name values and x is each of the cells.

pl.violin(adata, keys[, groupby, log, …])

../_images/scanpy.pl.violin.png

pl.stacked_violin(adata, var_names[, …])

../_images/scanpy.pl.stacked_violin.png

pl.matrixplot(adata, var_names[, groupby, …])

../_images/scanpy.pl.matrixplot.png

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, basis, *[, color, …])

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, basis, *[, color, …])

Scatter plot in tSNE basis.

pl.umap(adata, basis, *[, color, …])

Scatter plot in UMAP basis.

pl.diffmap(adata, basis, *[, color, …])

Scatter plot in Diffusion Map basis.

pl.draw_graph(adata, basis, *[, color, …])

Scatter plot in graph-drawing basis.

pl.embedding_density(adata, basis, key, *[, …])

Plot the density of cells in an embedding (per condition)

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[, …])

../_images/scanpy.pl.rank_genes_groups_stacked_violin.png

pl.rank_genes_groups_heatmap(adata[, …])

../_images/scanpy.pl.rank_genes_groups_heatmap.png

pl.rank_genes_groups_dotplot(adata[, …])

../_images/scanpy.pl.rank_genes_groups_dotplot.png

pl.rank_genes_groups_matrixplot(adata[, …])

../_images/scanpy.pl.rank_genes_groups_matrixplot.png

pl.rank_genes_groups_tracksplot(adata[, …])

Plot ranking of genes using heatmap plot (see heatmap())

Simulations

pl.sim(adata[, tmax_realization, …])

Plot results of simulation.