I am pretty new to plotting 3D graphs in R. I can easily work on scatter plot in 2D.
Here I am showing only Z1
just for the assumption of data. In reality Z2
also exists.
I have a dataset something like:
X Y Z1
10 8017 5.238290
13 8273 5.368710
15 9500 5.908030
17 6856 6.501010
19 8453 7.319200
20 4517 6.258901
21 7095 5.781290
24 7738 6.979810
25 8561 6.563700
26 7111 6.636700
29 9596 9.374410
How can I plot A
along the x axis, B
along the y axis and Z1
along the z axis? How can I form a bar 3d, mesh 3d and patch 3d ?
I did try on surface3d
and plot3d
but got error in handling data.
Please help on this.
The plot3d
command produces a plot which is of no use. and also type
is not working inside this command to change the shape (giving a blank plot page).
b <- read.table("dataset", header = T)
plot3d(b$X, b$Y, b$Z, xlab="x", ylab="y", zlab="z", col=rainbow(1000))
Instead of scattered points of Z1
along x and y, I'd like Z1
to be shown as 3D bars.
And surface3d
is throwing error like
"Error in rgl.surface(x = c(10L, 13L, 15L, 17L, 19L, 20L, 21L, 24L, 25L, :
y length != x rows * z cols"
My data is already combined into a dataset and I am accessing separate column into the surface3d
command but I don't have a clue what else I need to do.