I build a histogram in R using the rgl
package.
library(rgl)
rgl.bg(col="#cccccc")
x<-rnorm(2500)
y<-rnorm(2500)
hist3d(x, y, alpha=0.8, nclass=10, scale=30)
How can I add an axis with labels on the plot?
Update
Solution:
axes3d(c('x','y','z'))
title3d('','','xlab','ylab','zlab')
source code hist3d
is located in the demo(hist3d)
Add:
axes3d()
In case someone tries to run the above code: it is not self-contained, you need to copy the code for hist3d
and binplot
from ?hist3d.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With