plotSpatial2D | R Documentation |
Simple visualization of spatial coordinates. See example code for how to have information preset in the object. Arguments to the liger object method are passed down to ligerDataset method.
plotSpatial2D(object, ...)
## S3 method for class 'liger'
plotSpatial2D(object, dataset, useCluster = NULL, legendColorTitle = NULL, ...)
## S3 method for class 'ligerSpatialDataset'
plotSpatial2D(
object,
useCluster = NULL,
legendColorTitle = NULL,
useDims = c(1, 2),
xlab = NULL,
ylab = NULL,
labelText = FALSE,
panelBorder = TRUE,
...
)
object |
Either a liger object containing a spatial dataset or a ligerSpatialDataset object. |
... |
Arguments passed on to
|
dataset |
Name of one spatial dataset. |
useCluster |
Either the name of one variable in |
legendColorTitle |
Alternative title text in the legend. Default
|
useDims |
Numeric vector of two, choosing the coordinates to be drawn
on 2D space. (STARmap data could have 3 dimensions.) Default |
xlab , ylab |
Text label on x-/y-axis. Default |
labelText |
Logical, whether to label annotation onto the scatter plot.
Default |
panelBorder |
Whether to show rectangle border of the panel instead of
using ggplot classic bottom and left axis lines. Default |
A ggplot object
ctrl.fake.spatial <- as.ligerDataset(dataset(pbmc, "ctrl"), modal = "spatial")
fake.coords <- matrix(rnorm(2 * ncol(ctrl.fake.spatial)), ncol = 2)
coordinate(ctrl.fake.spatial) <- fake.coords
dataset(pbmc, "ctrl") <- ctrl.fake.spatial
defaultCluster(pbmc) <- pbmcPlot$leiden_cluster
plotSpatial2D(pbmc, dataset = "ctrl")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.