[R] plot3d with more than 8 colors

Birgit Lemcke birgit.lemcke at systbot.uzh.ch
Mon Oct 22 15:54:28 CEST 2007


Hello R user and helper!

I would like to get a 3d plot with coloured points.

I did that:

colors<-c(rep("2",7), rep("3",12), rep("4", 24), rep("5", 13), rep 
("6", 8), rep("7", 51), rep("8", 1), rep("9", 15), rep("10", 53), rep 
("11",3), rep("12",3), rep("13", 8), rep("14", 90), rep("15", 8), rep 
("16", 9), rep("17", 32), rep("18",11))

PCoA<-cmdscale(Dist.Gower, k = 3)
plot3d(PCoA, type="s",col= colors, size=0.5)

but I get only different colors for the numbers 1 to 8 and after that  
it starts again with the first colour black.

How can get more different colours?

And two further questions: how can I ad a legend to the 3d-plot and  
is there now a possibility to export movable 3d files?

Thanks in advance for your help.

Greetings

Birgit




Birgit Lemcke
Institut für Systematische Botanik
Zollikerstrasse 107
CH-8008 Zürich
Switzerland
Ph: +41 (0)44 634 8351
birgit.lemcke at systbot.uzh.ch



More information about the R-help mailing list