如何将轴添加到3D直方图(rgl)

时间:2021-09-26 14:58:09

I build a histogram in R using the rgl package.

我使用rgl包在R中构建直方图。

library(rgl)
rgl.bg(col="#cccccc")
x<-rnorm(2500)
y<-rnorm(2500)
hist3d(x, y, alpha=0.8, nclass=10, scale=30)

如何将轴添加到3D直方图(rgl)

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)

源代码hist3d位于demo(hist3d)中

1 个解决方案

#1


5  

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.

如果有人试图运行上面的代码:它不是自包含的,你需要从?hist3d复制hist3d和binplot的代码。

#1


5  

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.

如果有人试图运行上面的代码:它不是自包含的,你需要从?hist3d复制hist3d和binplot的代码。