简体   繁体   中英

Plot line that lies in a 2D plane in 3D axes in R

I would like to make the following plot in R. It is just a normal density sitting upright.

3D轴中的2D线

You want to use the scatterplot3d package

library(scatterplot3d)

d <- rnorm(10000)
y <- density(d)$y
x <- density(d)$x
z <- rep(0, length(x))
scatterplot3d(x=x, y=z, z=y, type="l")

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM