When plotting an embedding, we may want to plot specific cells, but constrain the scale to match plots of the whole dataset. Given a dim. reduction, this function extracts the x and y limits to use for plotting.

drLims(seurat, reduction = "tsne")

Arguments

seurat

Seurat object for which a dimensionality reduction has been computed (e.g. PCA or tSNE)

reduction

String, corresponding to the dimensionality reduction to use. Default: "tsne".

Value

A list with two elements: "xlim", which is a character vector of the limits for the x-axis, and "ylim", correspondingly for the y-axis

Examples

drLims(pbmc)
#> $xlim #> [1] -21.29039 19.81854 #> #> $ylim #> [1] -55.72633 33.26469 #>