Creates general-purpose 3D scatter plots using plotly. Unlike DimPlot's built-in 3D mode (which only works with dimension reduction data), this accepts any x/y/z columns with color and size mappings.
Usage
Scatter3D(
data,
x,
y,
z,
color_by = NULL,
color_name = NULL,
size_by = NULL,
size_name = NULL,
hover_text = NULL,
pt_alpha = 0.8,
palette = "forge",
palcolor = NULL,
title = NULL,
xlab = NULL,
ylab = NULL,
zlab = NULL,
width = NULL,
height = NULL,
legend.position = "right",
seed = 8525,
...
)Arguments
- data
A data frame containing the data to plot
- x, y, z
Column names for the three axes.
- color_by
Column for point coloring (categorical or continuous).
- color_name
Legend title for color.
- size_by
Column for point sizing, or a numeric value.
- size_name
Legend title for size.
- hover_text
Column for hover tooltip text.
- pt_alpha
Point opacity.
- palette
Color palette name
- palcolor
Custom colors for palette
- title
Plot title
- xlab
X-axis label
- ylab
Y-axis label
- zlab
Z-axis label (for 3D and ternary plots)
- width, height
Plot dimensions in pixels.
- legend.position
Legend position: "none", "left", "right", "bottom", "top"
- seed
Random seed for reproducibility
- ...
Additional arguments.
See also
Other 3d-interactive-plots:
Surface3D()
