Learn R Programming

destiny (version 2.0.4)

plot.DiffusionMap: 3D or 2D plot of diffusion map

Description

If you want to plot the eigenvalues, simply plot(eigenvalues(dm)[start:end], ...)

Usage

plot.DiffusionMap(x, dims, new_dcs = NULL, col = NULL, col_by = NULL,
  col_limits = NULL, col_new = "red", pal = NULL, ..., mar = NULL,
  ticks = FALSE, axes = TRUE, box = FALSE, legend_main = col_by,
  legend_opts = list(), interactive = FALSE,
  draw_legend = !is.null(col_by) || (length(col) > 1 && !is.character(col)),
  consec_col = TRUE, col_na = "grey", plot_more = function(p, ..., rescale
  = NULL) NULL)

# S4 method for DiffusionMap,numeric plot(x, y, ...)

# S4 method for DiffusionMap,missing plot(x, y, ...)

Arguments

dims, y
Diffusion components (eigenvectors) to plot (default: first three components; 1:3)
new_dcs
An optional matrix also containing the rows specified with y and plotted. (default: no more points)
col
Single color string or vector of discrete or categoric values to be mapped to colors. E.g. a column of the data matrix used for creation of the diffusion map. (default: par('fg'))
col_by
Specify a dataset(x) or phenoData(dataset(x)) column to use as color
col_limits
If col is a continuous (=double) vector, this can be overridden to map the color range differently than from min to max (e.g. specify c(0, 1))
col_new
If new_dcs is given, it will take on this color. (default: red)
pal
Palette used to map the col vector to colors. (default: use cube_helix for continuous and palette() for discrete data)
...
Parameters passed to plot, scatterplot3d, or plot3d (if interactive == TRUE)
mar
Bottom, left, top, and right margins (default: par(mar))
ticks
logical. If TRUE, show axis ticks (default: FALSE)
axes
logical. If TRUE, draw plot axes (default: Only if ticks is TRUE)
box
logical. If TRUE, draw plot frame (default: TRUE or the same as axes if specified)
legend_main
Title of legend. (default: nothing unless col_by is given)
legend_opts
Other colorlegend options (default: empty list)
interactive
Use plot3d to plot instead of scatterplot3d?
draw_legend
logical. If TRUE, draw color legend (default: TRUE if col_by is given or col is given and a vector to be mapped)
consec_col
If col or col_by refers to an integer column, with gaps (e.g. c(5,0,0,3)) use the palette color consecutively (e.g. c(3,1,1,2))
col_na
Color for NA in the data. specify NA to hide.
plot_more
Function that will be called while the plot margins are temporarily changed (its p argument is the rgl or scatterplot3d instance or NULL, its rescale argument is NULL or of the shape list(from = c(a, b), to = c(c,d)))

Value

The return value of the underlying call is returned, i.e. a scatterplot3d or rgl object.

Details

If you specify negative numbers as diffusion components (e.g. plot(dm, c(-1,2))), then the corresponding components will be flipped.

Examples

Run this code
data(guo)
plot(DiffusionMap(guo))

Run the code above in your browser using DataLab