0

1 つのデータセットと追加のプロットと平面を 3D Figure にプロットしました。軸を回転させてスナップショットを取得したい。

(1)rgl パッケージを使用して点と平面を追加でプロットできますか? (2) 図のように、scatterplot3d パッケージを使用して軸を手動で回転させることはできますか? (ムービーは必要ありません。)

rgl は scatterplot3d に比べて図形の鮮明さが相対的に悪いので、scatterplot3d を使用したいと考えています。 ここに画像の説明を入力

for (i in 0:100){
  A <- seq(1.0,84.0,2)
  B <- 84.0-A
  C <- 650*i*1.0/100 - A
  result_z <- A/84.0
  result_x <- A/(A+C)
  result_x <- result_x*100
  result_z <- result_z*100
  exer <- cbind(result_x,result_z,i)
  exer2_hoge3 <- rbind(exer2_hoge3,exer)
}
par(xpd=T)
figure <-scatterplot3d(x = exer2_hoge3[,1], y = exer2_hoge3[,3], z = exer2_hoge3[,2], pch = 1, xlab = "xlab", ylab = "ylab", zlab = "zlab",cex.axis = 1.5, cex.lab = 2, xlim = c(100,0), ylim = c(0,100), zlim = c(0,100)
                       ,color = "gray15", mar = c(5,5,5,5), cex.symbols = 1.2
)

par(new = T)
scatterplot3d(y = 3800.0/650, x = 3400.0/38, z = 3400.0/84, pch = "1", cex.symbols = 2.5, xlab = "", ylab = "", zlab = "", color = "black",cex.axis = 1.5,xlim = c(100,0), ylim = c(0,100), zlim = c(0,100), mar = c(5,5,5,5))
par(new = T)
scatterplot3d(y = 6500.0/650, x = 5600.0/65, z = 5600.0/84, pch = "2", cex.symbols = 2.5, xlab = "", ylab = "", zlab = "", color = "black",cex.axis = 1.5,xlim = c(100,0), ylim = c(0,100), zlim = c(0,100), mar = c(5,5,5,5))
par(new = T)
scatterplot3d(y = 6700.0/650, x = 5700.0/67, z = 5700.0/84, pch = "3", cex.symbols = 2.5, xlab = "", ylab = "", zlab = "", color = "black",cex.axis = 1.5,xlim = c(100,0), ylim = c(0,100), zlim = c(0,100), mar = c(5,5,5,5))
par(new = T)
scatterplot3d(y = 7500.0/650, x = 7100.0/75, z = 6100.0/84, pch = "4", cex.symbols = 2.5, xlab = "", ylab = "", zlab = "", color = "black",cex.axis = 1.5,xlim = c(100,0), ylim = c(0,100), zlim = c(0,100), mar = c(5,5,5,5))
par(new = T)
scatterplot3d(y = 7900.0/650, x = 7600.0/79, z = 6300.0/84, pch = "6", cex.symbols = 2.5, xlab = "", ylab = "", zlab = "", color = "black",cex.axis = 1.5,xlim = c(100,0), ylim = c(0,100), zlim = c(0,100), mar = c(5,5,5,5))
figure$plane3d(95, x.coef = 0, y.coef = 0, lty.box = "dashed") 
##### yz_additional plane
x0 <- 89
xyz1 <- figure$xyz.convert(rep(x0, 6), rep(0, 6), seq(0, 100, by=20))
xyz2 <- figure$xyz.convert(rep(x0, 6), rep(100, 6), seq(0, 100, by=20))
segments(xyz1$x, xyz1$y, xyz2$x, xyz2$y, lty="dashed")
xyz1 <- figure$xyz.convert(rep(x0, 6), seq(0, 100, by=20), rep(0, 6))
xyz2 <- figure$xyz.convert(rep(x0, 6), seq(0, 100, by=20), rep(100, 6))
segments(xyz1$x, xyz1$y, xyz2$x, xyz2$y, lty="dashed")
4

0 に答える 0