Skip to contents

Plot cell-level physical coordinates stored in a SpatialExperiment object.

Usage

plot_spatial(
  x,
  color_by,
  assay = "logcounts",
  smooth = FALSE,
  range = c(0.01, 0.99),
  out_dir = NULL
)

Arguments

x

A SpatialExperiment object.

color_by

Column metadata field(s) or feature(s) to color by.

assay

A character string indicating which expression values should be used.

smooth

A logical scalar. Smooth values. Helps to visualize expression patterns in a plot with many overlapping points.

range

A vector of 2 values indicating the minimum and maximum percentiles for the color range. Helps to visualize expression patterns when extreme outliers are present. For example, c(0, 0.99) will not expand the color scale above 99th percentile.

out_dir

Name of the output analysis directory. If specified, the plots will be saved there.

Value

.