From gs at statlab.uni-heidelberg.de  Fri Jul 10 21:22:26 2015
From: gs at statlab.uni-heidelberg.de (G. Sawitzki)
Date: Fri, 10 Jul 2015 21:22:26 +0200
Subject: [Rd] colour palettes in biplot
Message-ID: <55A01B72.6020608@statlab.uni-heidelberg.de>

biplot could benefit from allowing colour palettes,

eg. allowing col=list(xcol= xxpal, ycol= yypal) where xxpal and yypal
are palettes.

For an example, see the robust pricipal components in the principal
componetent section of
	<http://www.statlab.uni-heidelberg.de/data/olive/olive10.pdf>


The required change is to replace
col[1L] resp. col[2L] by col[1L]] reep. col[[2L]] for example in

 plot(x, type = "n", xlim = xlim, ylim = ylim, col = col[[1L]], ## <<
         xlab = xlab, ylab = ylab, sub = sub, main = main, ...)


Existing code should not be broken by this change.

Yours,
  gs.


>From valentin.todorov at chello.at:
> library(rrcov)
> 
> pc <- PcaProj(iris[,1:4], 3, scale=TRUE)
> windows(8,5)
> par(mfrow=c(1,2))
> biplot(pc)
> 
> col <- list(xcol=as.numeric(iris[,5])+2, ycol="red")
> biplot(pc, col=col)
> 

-- 
G. Sawitzki
StatLab Heidelberg
Im Neuenheimer Feld 294
D 69120 Heidelberg
Tel. (+49) 62 21 - 54 89 79   Fax (+49) 62 21 - 54 53 31
    <http://www.statlab.uni-heidelberg.de/users/gs/>
GPG Fingerprint: FEA4 3F2A 88B2 2629 6CE2 0429 CC3C E49E D159 99AE



[Rd] colour palettes in biplot
G. Sawitzki