plot3js.Rd
A high level method for generating a 3D scatter or line plot.
plot3js(
x,
y,
z,
xlim = NULL,
ylim = NULL,
zlim = NULL,
xlab = NULL,
ylab = NULL,
zlab = NULL,
label = NULL,
type = "points",
geometry = NULL,
axislabel_line = 3,
aspect = NULL,
label_axes = c("x", "y", "z"),
draw_box = TRUE,
draw_grid = TRUE,
grid_lwd = 1,
grid_col = "grey90",
axis_lwd = grid_lwd,
box_lwd = grid_lwd,
box_col = grid_col,
background = "#ffffff",
...
)
x coords for points / lines
y coords for points / lines
z coords for points / lines
plot x limits
plot y limits
plot z limits
x axis label
y axis label
z axis label
optional vector of interactive point labels
one of "points" or "lines"
should points and lines be represented as physical
geometries? Default for points is TRUE and for lines is FALSE, see
points()
and lines()
for more information.
Distance of axis label from plot
Plot axis aspect ratio, see plot3js.window()
Vector of axes to label, any combination of "x", "y" and "z"
Should a box be drawn around the plot
Should an axis grid be drawn in the background
Grid line width
Grid line color
Axis line width
Box line width
Box color
Background color for the plot
Further parameters to pass to material3js()
Returns a data3js object, that can be plotted as a widget using
print()
or r3js()
or further added to with the other plotting
functions.
# Simple plot example
p <- plot3js(
x = iris$Sepal.Length,
y = iris$Sepal.Width,
z = iris$Petal.Length,
col = rainbow(3)[iris$Species],
xlab = "Sepal Length",
ylab = "Sepal Width",
zlab = "Petal Length"
)
r3js(p, zoom = 2)
# Plotting with point rollover info and highlighting
p <- plot3js(
x = USJudgeRatings$CONT,
y = USJudgeRatings$INTG,
z = USJudgeRatings$DMNR,
highlight = list(
col = "darkgreen",
size = 2.5
),
xlab = "CONT",
ylab = "INTG",
zlab = "DMNR",
size = 2,
col = "green",
label = rownames(USJudgeRatings)
)
r3js(p, zoom = 2)