I calculated the niche width (from min to max extend) of a species related to 3 different variables. I now want to draw them in r as a single box showing var1 on the x-axis, var2 on the y-axis and var3 on the z-axis. This should result in a single box that is placed along the 3 axes.
I tried the rgl package in r.
# this is the extent of my scale
x <- c(31.94, 9460.00)
y <- c(28, 14375)
z <- c(0.02, 95.11)
# these are the coordinates of my box
x1<- 42.69
y1<- 4
z1<- 0.03
x2<- 3686.996
y2<- 1997.317
z2<- 5.156709
# my code is:
library(rgl) # load package
open3d() #open plot
plot3d(x, y, z, xlab="EC 1:5 [mS/cm]", ylab = "Na {mg/kg]", zlab="SAR") # plot axes
printBox(x1,y1,z1,x2,y2,z2) #add box
Unfortunately, this code adds the box (x1,y1,z1) at the lower-left corner of the set axes and extents the box to both, the neg. and pos. direction (x2,y2,z2).
Instead, I would like this code to add the box into the existing coordinates (plot3d()) with the lower-left corner at x1,y1,z1 and the upper left corner at x2,y2,z2.
I would be grateful for any help.