I am trying to plot a 3d cube in blogdown. The code could be e.g.
library(rgl)
x=2
y=3
z=1
plot3d(x, y, z, col = rainbow(1000), xlim = c(-4,4), ylim = c(-4, 4), zlim = c(-2, 2))
abclines3d(2, 3, 1, a = diag(3), col = "gray")
Unfortunately, when insertig the code from above into a blogdown post, the graph doesn't show up.
Any idea? My hunch is that this has something to do with the rgl package or possibly htmlwidgets? But I couldn't figure out what to do next.
To be clear, i don't have to use the rgl package necessarily. My primary goal is to produce a 3d cube with scattered dots.