get_figures#
API pages include interactive (HTML) plots that would possibly not render correctly on a mobile device.
- get_figures(grid: SupPlotsSpec, indices: Sequence[int], **kwargs) SupPlotsSpec#
Get multiple figures from a grid (SupPlotsSpec) as a new grid.
- Parameters:
grid (
SupPlotsSpec) – The grid to pull figures from.indices (
Sequence[int]) – The indices of the figures to include. Negative indices are supported.**kwargs (
dict[str,Any]) – Additional arguments forwarded to gggrid. see: https://lets-plot.org/python/pages/api/lets_plot.gggrid.html
- Returns:
SupPlotsSpec– A new grid containing the selected figures.- Raises:
TypeError – If grid is not a SupPlotsSpec or indices is not a Sequence of ints.
IndexError – If any value in indices is out of range for the grid.
Examples
Get multiple plots from a grid.
import scanpy as sc from lets_plot import * import cellestial as cl data = cl.datasets.pbmc3k(cache_directory="data") grid = cl.expressions( data, keys=["MALAT1", "YBX3", "MNDA" ,"HLA-DRA"], axis_type="arrow", color_high="red", ncol=2, ) cl.get_figures(grid, indices=[1, 3])