【问题标题】:How to find out index in plotly in R [closed]如何在R中找出索引[关闭]
【发布时间】:2020-10-13 04:09:05
【问题描述】:

在这个网站https://plotly.com/r/trisurf/ 上有很多 3D 人物。例如

library(plotly)

fig <- plot_ly(
  x = c(0, 1, 2, 0),
  y = c(0, 0, 1, 2),
  z = c(0, 2, 0, 1),
  i = c(0, 0, 0, 1),
  j = c(1, 2, 3, 2),
  k = c(2, 3, 1, 3),
  facecolor = toRGB(viridisLite::viridis(4))
)

fig

我不明白如何找到这个:

i = c(0, 0, 0, 1),
      j = c(1, 2, 3, 2),
      k = c(2, 3, 1, 3)

【问题讨论】:

  • this 有帮助吗?
  • Here 是一本书。

标签: r plot 3d plotly


【解决方案1】:

xyz 向量:

  x = c(0, 1, 2, 0),
  y = c(0, 0, 1, 2),
  z = c(0, 2, 0, 1),

代表四个点(0,0,0)(1,0,2)(2,1,0)(0,2,1)。它们分别由 0、1、2、3 索引。

ijk 向量:

i = c(0, 0, 0, 1),
j = c(1, 2, 3, 2),
k = c(2, 3, 1, 3)

代表四个三角形。第一个由(0,1,2) 表示。这意味着相应三角形的顶点是由 0、1、2 索引的点。第二个,(0,2,3),是其顶点是由 0、2、3 索引的点的三角形。等等。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-22
    • 1970-01-01
    • 2021-10-31
    • 2019-07-13
    • 1970-01-01
    相关资源
    最近更新 更多