I want to use rgl.surface(x,z,y...)
to draw a 3d graph.
However, my z axis is not numeric, like Mon, Tues, Wens....
So how can I use rgl.surface
, or other functions to draw a graph?
I want to use rgl.surface(x,z,y...)
to draw a 3d graph.
However, my z axis is not numeric, like Mon, Tues, Wens....
So how can I use rgl.surface
, or other functions to draw a graph?
Simply convert your axis to a numeric range, e.g.
z <- c("Mon", "Tues", "Wed")
zn <- seq_along(z)
You can then use zn in any plotting function. You'll need to draw axes manually to include the appropriate labels.
For example,
x <- y <- 1:3
plot3d(x, y, zn, axes = FALSE)
box3d()
axis3d("x")
axis3d("y")
axis3d("z", at=zn, labels=z)