arrow_axis#

API pages include interactive (HTML) plots that would possibly not render correctly on a mobile device.

arrow_axis(*, plot: PlotSpec | None = None, size: float = 1, length: float = 0.25, angle: float = 10, color: str = '#3f3f3f', **arrow_kwargs) DeferredLayer#

Layer of arrows as the X and Y axis to the plot.

Parameters:
  • plot (PlotSpec | None, default None) – If provided, the arrow axis is built from this plot’s data and aesthetics regardless of which plot the resulting layer is added to. When None, the layer is deferred and introspects the plot it is added to via +.

  • size (float) – Width of the axis lines.

  • color (str) – Color of the arrow.

  • angle (float) – Angle of the arrow head in degrees.

  • length (float) – Span of each axis line as a fraction of its data range (0.25 covers 25%).

  • **arrow_kwargs – Additional parameters for the arrow layer. For more information on arrow parameters, see: https://lets-plot.org/python/pages/api/lets_plot.arrow.html

Returns:

DeferredLayer

Raises:

MissingAestheticError – If x or y cannot be inferred from the receiving plot.

Notes

Uses geom_path to draw the axis lines and geom_segment for the arrowheads.

Examples

Without arrow.

import scanpy as sc
from lets_plot import *

import cellestial as cl

data = cl.datasets.pbmc3k(cache_directory="data")

umap = cl.umap(data,"HBA2")
umap

Adding the arrow axis.

import scanpy as sc
from lets_plot import *

import cellestial as cl

data = cl.datasets.pbmc3k(cache_directory="data")

umap = cl.umap(data,"HBA2")
umap + cl.arrow_axis()

Arrow customization.

import scanpy as sc
from lets_plot import *

import cellestial as cl

data = cl.datasets.pbmc3k(cache_directory="data")

umap = cl.umap(data,"HBA2")
umap + cl.arrow_axis(length=0.20,color="dark_violet")