plot3d-SlingshotDataSet | R Documentation |
Tools for visualizing lineages inferred by slingshot
.
plot3d.SlingshotDataSet(
x,
type = NULL,
linInd = NULL,
add = FALSE,
dims = seq_len(3),
aspect = "iso",
size = 10,
col = 1,
...
)
x |
a |
type |
character, the type of output to be plotted, can be one of
|
linInd |
integer, an index indicating which lineages should be plotted
(default is to plot all lineages). If |
add |
logical, indicates whether the output should be added to an existing plot. |
dims |
numeric, which dimensions to plot (default is |
aspect |
either a logical indicating whether to adjust the aspect ratio
or a new ratio, see |
size |
numeric, size of points for MST (default is |
col |
character or numeric, color(s) for lines, see |
... |
additional parameters to be passed to |
If type == 'lineages'
, straight line connectors between
cluster centers will be plotted. If type == 'curves'
, simultaneous
principal curves will be plotted.
When type
is not specified, the function will first check the
curves
slot and plot the curves, if present. Otherwise,
lineages
will be plotted, if present.
returns NULL
.
library(rgl)
data("slingshotExample")
rd <- slingshotExample$rd
cl <- slingshotExample$cl
rd <- cbind(rd, rnorm(nrow(rd)))
pto <- slingshot(rd, cl, start.clus = "1")
sds <- SlingshotDataSet(pto)
plot3d.SlingshotDataSet(sds, type = 'b')
# add to existing plot
plot3d(rd, col = 'grey50', aspect = 'iso')
plot3d.SlingshotDataSet(sds, lwd = 3, add = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.