SingleSpatialPlot: Base plotting function for all Spatial plots

View source: R/visualization.R

SingleSpatialPlotR Documentation

Base plotting function for all Spatial plots

Description

Base plotting function for all Spatial plots

Usage

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

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.

image.scale

Choose the scale factor ("lowres"/"hires") to apply in order to matchthe plot with the specified 'image' - defaults to "lowres"

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

shape

Control the shape of the spots - same as the ggplot2 parameter. The default is 21, which plots cirlces - use 22 to plot squares.

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

Value

A ggplot2 object


Seurat documentation built on May 29, 2024, 4:20 a.m.