Learn R Programming

Seurat (version 5.0.3)

SingleSpatialPlot: Base plotting function for all Spatial plots

Description

Base plotting function for all Spatial plots

Usage

SingleSpatialPlot(
  data,
  image,
  cols = NULL,
  image.alpha = 1,
  pt.alpha = NULL,
  crop = TRUE,
  pt.size.factor = NULL,
  stroke = 0.25,
  col.by = NULL,
  alpha.by = NULL,
  cells.highlight = NULL,
  cols.highlight = c("#DE2D26", "grey50"),
  geom = c("spatial", "interactive", "poly"),
  na.value = "grey50"
)

Value

A ggplot2 object

Arguments

data

Data.frame with info to be plotted

image

SpatialImage object to be plotted

cols

Vector of colors, each color corresponds to an identity class. This may also be a single character or numeric value corresponding to a palette as specified by brewer.pal.info. By default, ggplot2 assigns colors

image.alpha

Adjust the opacity of the background images. Set to 0 to remove.

pt.alpha

Adjust the opacity of the points if plotting a SpatialDimPlot

crop

Crop the plot in to focus on points plotted. Set to FALSE to show entire background image.

pt.size.factor

Sets the size of the points relative to spot.radius

stroke

Control the width of the border around the spots

col.by

Mapping variable for the point color

alpha.by

Mapping variable for the point alpha value

cells.highlight

A list of character or numeric vectors of cells to highlight. If only one group of cells desired, can simply pass a vector instead of a list. If set, colors selected cells to the color(s) in cols.highlight

cols.highlight

A vector of colors to highlight the cells as; ordered the same as the groups in cells.highlight; last color corresponds to unselected cells.

geom

Switch between normal spatial geom and geom to enable hover functionality

na.value

Color for spots with NA values