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

Marc Girondot marc_grt at yahoo.fr
Fri Mar 15 10:37:08 CET 2013


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 plot as below:
>
> library(rgl)
> plot3d(x=x, y=y, z=z, col=nbcol[zcol], box=FALSE)
>
I have never use such a plot. Sorry

Marc
> Is there any way to add the same legend to this 3d plot?
>
> I'm new to R and try to learn it. I'm very grateful for any help!
>
> thanks,
> Z
>
>


-- 
__________________________________________________________
Marc Girondot, Pr

Laboratoire Ecologie, Systématique et Evolution
Equipe de Conservation des Populations et des Communautés
CNRS, AgroParisTech et Université Paris-Sud 11 , UMR 8079
Bâtiment 362
91405 Orsay Cedex, France

Tel:  33 1 (0)1.69.15.72.30   Fax: 33 1 (0)1.69.15.73.53
e-mail: marc.girondot at u-psud.fr
Web: http://www.ese.u-psud.fr/epc/conservation/Marc.html
Skype: girondot



More information about the R-help mailing list