简体   繁体   中英

Make a 3-d plot using rgl in R?

I have a matrix z that spits out a 20 by 20 matrix with with values starting at -9 to -739. I downloaded rgl but I can't figure out how to use it with my matrix: z[i, j]

How about:

set.seed(101)
z <- matrix(sample(-739:-9,replace=TRUE,400),20)
library(rgl)
persp3d(z,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