[R] [RGL] Need help to modify current plot
Duncan Murdoch
murdoch.duncan at gmail.com
Tue May 18 12:21:42 CEST 2010
Megh Dal wrote:
> Dear folks, I have created a plot on RGL device :
>
> x = 1:6
> y = seq(-12, 5, by=1)
> z = matrix(0, length(y), length(x))
> z[13,3] = 1; z[13,4] = 1.011765
> surface3d(x, y, t(z), col=rainbow(1000))
> grid3d(c("x-", "y-", "z"))
>
> Now I want to draw 2 lines along x=3 & x=4, over the surface (with different colour). Could somebody help me how to draw that?
>
>
x=3 and x=4 specify planes, not lines, so you'll need to give more
information to choose lines. Here's one possibility:
save <- par3d(ignoreExtent=TRUE)
segments3d(c(3,3,4,4), c(min(y), max(y), min(y), max(y)), c(max(z),
max(z), max(z), max(z)), col="red")
par3d(save)
Duncan Murdoch
More information about the R-help
mailing list