I have generated these data:
dat = MASS::mvrnorm(n = 50,
mu = c(1, 5),
Sigma = matrix(c(1, 0.5, 0.5, 1), nrow = 2),
empirical = TRUE)
I can generate a 2D histogram with the following code:
plot_ly(x = dat[,1], y = dat[,2], type = "histogram2dcontour")
How can I generate a plot of these same data in 3D - either as a 3D histogram or 3D kernel density distribution?