Description Usage Arguments Value Note Examples
Add points to a 3D scatterplot
1 |
s |
A non-animated scatterplot object returned by |
x |
Either a vector of x-coordinate values or a three-column data matrix with columns corresponding to the x,y,z coordinate axes. Column labels, if present, are used as axis labels. |
y |
(Optional) vector of y-coordinate values, not required if
|
z |
(Optional) vector of z-coordinate values, not required if
|
color |
Either a single hex or named color name (all points same color),
or a vector of hex or named color names as long as the number of points in |
pch |
Optional point glyphs or text strings, see |
size |
The plot point radius, either as a single number or a
vector of sizes of length |
labels |
Character vector of length |
A new scatterplot htmlwidget object.
This function replaces the old points3d
approach used by scatterplot3d
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
# Adding point labels to a scatterplot:
x <- rnorm(5)
y <- rnorm(5)
z <- rnorm(5)
scatterplot3js(x, y, z, pch="o") %>%
points3d(x + 0.1, y + 0.1, z, color="red", pch=paste("point", 1:5))
# Adding point labels to a graph, obtaining the graph vertex coordinates
# with the `vertices()` function:
data(LeMis)
graphjs(LeMis) %>% points3d(vertices(.), color="red", pch=V(LeMis)$label)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.