Couple normal en 3D

Goodmorning
I would like to know how to plot the density of a normal couple (3D gauss bell).

Thank you.

Hello,

Could you provide us with a bit more detail on what exactly you are trying to plot, maybe give an example of the type of curve you have in mind.

From what you write, it might be that the bivariate package could be helpful.

Hope this helps,
PJ

library(tidyverse)
library(rayshader)
dim1<-dnorm(seq(from=0,to=1,by=0.01),mean=.5,sd=.2)

mygrid<-expand_grid(x=1:100,y=1:100)

mygrid$value <- dim1[mygrid$x] * dim1[mygrid$y]

(g<- ggplot(mygrid, aes(x, y)) +
  geom_raster(aes(fill = value)) +
    scale_fill_gradient(
      low = "#FFFFFF",
      high = "#000000"
    )
)
rayshader::plot_gg(ggobj = g,multicore = TRUE
                   ,phi=0,theta=0 )

image

The result is interactive if you mouse around you'll change the viewing angle.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.