Visualize clusters or other categorical groupings in a spatial context
ImageDimPlot(
object,
fov = NULL,
boundaries = NULL,
group.by = NULL,
split.by = NULL,
cols = NULL,
shuffle.cols = FALSE,
size = 0.5,
molecules = NULL,
mols.size = 0.1,
mols.cols = NULL,
mols.alpha = 1,
nmols = 1000,
alpha = 1,
border.color = "white",
border.size = NULL,
na.value = "grey50",
dark.background = TRUE,
crop = FALSE,
cells = NULL,
overlap = FALSE,
axes = FALSE,
combine = TRUE,
coord.fixed = TRUE,
flip_xy = TRUE
)
If combine = TRUE
, a patchwork
ggplot object; otherwise, a list of ggplot objects
A Seurat
object
Name of FOV to plot
A vector of segmentation boundaries per image to plot; can be a character vector, a named character vector, or a named list. Names should be the names of FOVs and values should be the names of segmentation boundaries
Name of one or more metadata columns to group (color) cells by (for example, orig.ident); pass 'ident' to group by identity class
A factor in object metadata to split the plot by, pass 'ident' to split by cell identity'
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. We also include a number of palettes from the pals package.
See DiscretePalette
for details.
Randomly shuffle colors when a palette or
vector of colors is provided to cols
Point size for cells when plotting centroids
A vector of molecules to plot
Point size for molecules
A vector of color for molecules. The "Set1" palette from RColorBrewer is used by default.
Alpha value for molecules, should be between 0 and 1
Max number of each molecule specified in `molecules` to plot
Alpha value for plotting (default is 1)
Color of cell segmentation border; pass NA
to suppress borders for segmentation-based plots
Thickness of cell segmentation borders; pass NA
to suppress borders for centroid-based plots
Color value for NA points when using custom scale
Set plot background to black
Crop the plots to area with cells only
Vector of cells to plot (default is all cells)
Overlay boundaries from a single image to create a single
plot; if TRUE
, then boundaries are stacked in the order they're
given (first is lowest)
Keep axes and panel background
Combine plots into a single
patchwork
ggplot object.If FALSE
,
return a list of ggplot objects
Plot cartesian coordinates with fixed aspect ratio
Flag to flip X and Y axes. Default is FALSE.