File:Threejs 3d.png
Appearance
Size of this preview: 800 × 584 pixels. Other resolution: 1,472 × 1,074 pixels.
Original file (1,472 × 1,074 pixels, file size: 163 KB, MIME type: image/png)
Summary
# method 2. High-performance WebGL: threejs (great for large datasets)
library(threejs)
# numeric color vector by Species
cols <- as.numeric(iris$Species)
pal <- rainbow(length(unique(cols)))
widget <- scatterplot3js(
x = iris$Sepal.Length,
y = iris$Sepal.Width,
z = iris$Petal.Length,
color = pal[cols],
size = .8, # control marker sizes
grid = TRUE,
renderer = "auto", # or "webgl" (webgl recommended for speed)
bg = "white",
labels = paste0("Specimen: ", 1:nrow(iris))
)
widget
# Use htmlwidgets::saveWidget(widget, "iris_threejs.html", selfcontained = TRUE)
File history
Click on a date/time to view the file as it appeared at that time.
| Date/Time | Thumbnail | Dimensions | User | Comment | |
|---|---|---|---|---|---|
| current | 13:50, 19 February 2026 | 1,472 × 1,074 (163 KB) | Brb (talk | contribs) | <syntaxhighlight lang='r'> # method 2. High-performance WebGL: threejs (great for large datasets) library(threejs) # numeric color vector by Species cols <- as.numeric(iris$Species) pal <- rainbow(length(unique(cols))) widget <- scatterplot3js( x = iris$Sepal.Length, y = iris$Sepal.Width, z = iris$Petal.Length, color = pal[cols], size = .8, # control marker sizes grid = TRUE, renderer = "auto", # or "webgl" (webgl recommended for speed) bg = "white", l... |
You cannot overwrite this file.
File usage
The following page uses this file: