Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example PCA plots #1813

Merged
merged 5 commits into from
May 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions scanpy/plotting/_tools/scatterplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,37 @@ def pca(
Returns
-------
If `show==False` a :class:`~matplotlib.axes.Axes` or a list of it.

Examples
--------

.. plot::
:context: close-figs

import scanpy as sc
adata = sc.datasets.pbmc3k_processed()
sc.pl.pca(adata)

Colour points by discrete variable (Louvain clusters).

.. plot::
:context: close-figs

sc.pl.pca(adata, color="louvain")

Colour points by gene expression.

.. plot::
:context: close-figs

sc.pl.pca(adata, color="CST3")

.. currentmodule:: scanpy

See also
--------
tl.pca
pp.pca
"""
if not annotate_var_explained:
return embedding(
Expand Down