Skip to contents

Plot cells based on spatial coordinates.

Usage

plotSpatial(
  spe,
  reverseY = FALSE,
  group.by = NULL,
  cols = NULL,
  pt.shape = 16,
  pt.size = 0.3,
  pt.alpha = 0.5
)

Arguments

spe

A SpatialExperiment object.

reverseY

Reverse y coordinates.

group.by

values to group points by. Must be in colData of spe. If NULL, will try with 'cols' if available.

cols

Colour palette. Can be a vector of colours or a function that accepts an integer n and return n colours.

pt.shape

shape of points.

pt.size

size of points.

pt.alpha

alpha of points between 0 and 1.

Value

A ggplot object.

Examples


data("xenium_bc_spe")

plotSpatial(spe, group.by = "cell_type", pt.size = 0.5, pt.alpha = 0.6)