Rの3Dプロットに2Dプロットを追加することは可能ですか?hist3D 2DプロットのバックグラウンドR
私は以下の3次元バープロットを生成するRコードを持っています。唯一
dt = structure(c(1, 1, 1, 3,
0, 2, 2, 1,
1, 2, 1, 3,
2, 6, 3, 1,
1, 2, 3, 0,
1, 0, 2, 1,
1,2,2,2), .Dim = c(4L, 7L), .Dimnames = list(c("0-50",
"51-60", "61-70", "71-80"
), c("0-50", "51-60", "61-70", "71-80", "81-90", "91-100", "101-Inf")))
m <- matrix(rep(seq(4),each=7), ncol=7, nrow=4, byrow = TRUE)
hist3D(x = 1:4, z = dt, scale = T,bty="g", phi=35,theta=30,border="black",space=0.15,col = jet.col(5, alpha = 0.8), add = F, colvar = m, colkey = F, ticktype = "detailed")
hist3dコール:
は、私はプロットを追加できることです探しています何を:これは、次の3Dプロットを生成
hist3D(x = 1:4, z = dt, scale = T,bty="g", phi=35,theta=30, border="black", space=0.15,col = jet.col(5, alpha = 0.8), add = F, colvar = m, colkey = F, ticktype = "detailed")
灰色のグリッドがある位置。出来ますか?
ありがとうございます!
2Dプロットを追加します。私はあなたが 'hist3D'関数をハックすることなく' plot3D'でそれを行うことはできないと思います。 'rgl'でそれを行うには、' plot3d'を使って3Dプロットを作成してから、 'points3d'や' lines3d'や 'add = T'を使って新しい2Dプロットの点をスーパーインポーズすることができます。すべての点で軸の1つを0に設定するだけで2Dになります。 –
@ Hack-Rヒントありがとうございます。あなたが言ったように私は試みます。 –