Interactive 3D scatter plot via plotly
threeDplot.RdInteractive 3D scatter plot via plotly
Usage
threeDplot(
data,
x_var,
y_var,
z_var,
color_var,
col_palette = NULL,
continuous = FALSE,
x_lab = "x",
y_lab = "y",
z_lab = "z",
title = "",
xrange = NULL,
yrange = NULL,
zrange = NULL,
eye = "pos1",
zoom = 1
)Arguments
- data
Data frame containing the variables to plot.
- x_var
Character; column name for the X axis.
- y_var
Character; column name for the Y axis.
- z_var
Character; column name for the Z axis.
- color_var
Character; column name mapped to point color.
- col_palette
Character vector of colors for the color scale; or
NULLto use the plotly default. Defaults toNULL.- continuous
Logical; if
TRUE, treatscolor_varas a continuous scale; ifFALSE, as a discrete factor. Defaults toFALSE.- x_lab
Character; X-axis label. Defaults to
"x".- y_lab
Character; Y-axis label. Defaults to
"y".- z_lab
Character; Z-axis label. Defaults to
"z".- title
Character; plot title. Defaults to
"".- xrange
Numeric vector of length 2 for X-axis limits, or
NULLfor automatic. Defaults toNULL.- yrange
Numeric vector of length 2 for Y-axis limits, or
NULL. Defaults toNULL.- zrange
Numeric vector of length 2 for Z-axis limits, or
NULL. Defaults toNULL.- eye
Character preset (
"pos1","pos2","pos3") or a named list withx,y,zfor the camera position. Defaults to"pos1".- zoom
Numeric; camera zoom factor. Defaults to
1.