Re: [R] Add a continuous color ramp legend to a 3d scatter plot

2013-03-15 Thread Zhuoting Wu
Marc, Thank you very much for your reply! It helps tremendously! best, Z On Fri, Mar 15, 2013 at 2:37 AM, Marc Girondot wrote: > Le 14/03/13 18:15, Zhuoting Wu a écrit : > > I have two follow-up questions: >> >> 1. If I want to reverse the heat.colors (i.e., from yellow to red instead >> of

Re: [R] Add a continuous color ramp legend to a 3d scatter plot

2013-03-15 Thread Marc Girondot
Le 14/03/13 18:15, Zhuoting Wu a écrit : I have two follow-up questions: 1. If I want to reverse the heat.colors (i.e., from yellow to red instead of red to yellow), is there a way to do that? nbcol <- heat.colors(128) nbcol <- nbcol[128:1] 2. I also created this interactive 3d scatter plo

Re: [R] Add a continuous color ramp legend to a 3d scatter plot

2013-03-14 Thread Zhuoting Wu
I have two follow-up questions: 1. If I want to reverse the heat.colors (i.e., from yellow to red instead of red to yellow), is there a way to do that? 2. I also created this interactive 3d scatter plot as below: library(rgl) plot3d(x=x, y=y, z=z, col=nbcol[zcol], box=FALSE) Is there any way to

Re: [R] Add a continuous color ramp legend to a 3d scatter plot

2013-03-14 Thread Zhuoting Wu
Marc, Thank you so much! It works! I really appreciate your help! best, Z On Wed, Mar 13, 2013 at 8:39 PM, Marc Girondot wrote: > Hi, > > Try this. > Sincelery, > > Marc > > x <- rnorm(128, 10, 2) > y <- rnorm(128, 10, 2) > > z <- x+y > > nbcol <- heat.colors(128) > > # standardize z to be fr

Re: [R] Add a continuous color ramp legend to a 3d scatter plot

2013-03-13 Thread Marc Girondot
Hi, Try this. Sincelery, Marc x <- rnorm(128, 10, 2) y <- rnorm(128, 10, 2) z <- x+y nbcol <- heat.colors(128) # standardize z to be from 1 to 128 zcol <- ((z-min(z))/(max(z)-min(z)))*127+1 library(scatterplot3d) library(fields) scatterplot3d(x,y,z, pch=16,color=nbcol[zcol], grid=FALSE, bo

Re: [R] Add a continuous color ramp legend to a 3d scatter plot

2013-03-13 Thread Marc Girondot
Le 12/03/13 23:43, Zhuoting Wu a écrit : > I have a 3 column dataset x,y,z, and I plotted a 3d scatter plot using: > > cols <- myColorRamp(c(topo.colors(10)),z) > plot3d(x=x, y=y, z=z, col=cols) > > I wanted to add a legend to the 3d plot showing the color ramp. Any help > will be greatly appreciat

[R] Add a continuous color ramp legend to a 3d scatter plot

2013-03-12 Thread Zhuoting Wu
I have a 3 column dataset x,y,z, and I plotted a 3d scatter plot using: cols <- myColorRamp(c(topo.colors(10)),z) plot3d(x=x, y=y, z=z, col=cols) I wanted to add a legend to the 3d plot showing the color ramp. Any help will be greatly appreciated! thanks, Z [[alternative HTML version de