简体   繁体   中英

Plotting a single point (x, y, z) in three dimensional space using R

I am trying to plot one single (x, y, z) point in 3 dimensional space, similar to the graph here: 示例3D图形

I have tried using the scatter3d function from the rgl library, however I am stuck over how to get the point itself. I tried the following:

scatter3d(x=-4, y=0, z=-1)

which resulted in: 结果

I am not sure how to structure the data to get the point. Is there another library that I could use which is better suited for this? Or am I using this function the wrong way?

To reproduce your first plot

library(rgl)
x=2
y=3
z=1
plot3d(x, y, z, col = rainbow(1000), xlim = c(-4,4), ylim = c(-4, 4), zlim = c(-2, 2))
abclines3d(2, 3, 1, a = diag(3), col = "gray")

在此处输入图片说明

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