[adegenet-forum] Change Colors in Colorplot()

Romain Lehnebach Cirad romain.lehnebach at cirad.fr
Mon Jan 27 14:48:24 CET 2014


Thibaut,

Thank you very much to respond so quickly.

I tested 8 available combinations, but unfortunately, none produce 
exactly what we expect.
However one combination is better than others, and it's a first step ...
Any other ideas are always welcomed.

Thank you again.

Best regards;
Romain


Le 27/01/2014 09:32, Jombart, Thibaut a écrit :
> Hi there,
>
> thanks for re-posting on the forum.
>
> The sign of scores being arbitrary, there's a bit of tweaking to be made here. For instance:
> ## using the example in the doc
> xy <- expand.grid(1:10,1:10)
> df <- data.frame(x=1:100, y=100:1, z=runif(100,0,100))
> colorplot(xy,df,cex=10,main="colorplot: toy example") # default version
>
> ## tweaking colors by changing the signs
> newdf <- df
> newdf[,1] <- -newdf[,1]
> colorplot(xy,newdf,cex=10,main="colorplot: toy example")
>
> ## another tweak
> newdf[,2] <- -newdf[,2]
> colorplot(xy,newdf,cex=10,main="colorplot: toy example")
>
> ## etc.
>
> There's 8 schemes in total for 3 variables. It may be useful to have a function allowing to select a particular scheme, but I've never coded it (simple, but I don't really have time to do this right away).
>
> Cheers
> Thibaut
>
> ________________________________________
> From: adegenet-forum-bounces at lists.r-forge.r-project.org [adegenet-forum-bounces at lists.r-forge.r-project.org] on behalf of Romain Lehnebach Cirad [romain.lehnebach at cirad.fr]
> Sent: 27 January 2014 12:18
> To: adegenet-forum at lists.r-forge.r-project.org
> Subject: [adegenet-forum] Change Colors in Colorplot()
>
> Hello everybody,
>
> As a part of a study about dispersion and domestication of a cultivated
> species, we used sPCA as complement of others analyses. More
> specifically, we used colorplot() function based on the scores of the
> third first global components.
> In order to facilitate the reading of our future readers, we want to
> keep the same colour scheme we used in other analyses. This colour
> scheme depict geographical origins of our samples. Thus, we want to
> produce a colorplot with colours according to other analyses.
> I had a precise look on the construction of colorplot function, but I
> can not find the way to modify the function in order to obtain the
> expected colours ...
> One way, I guess, is to modify the scores on each axis to obtain the
> good RGB combination.
> But, it seems, quite hard to find the good combination, since we used 3
> axis ...
>
> Any advices, ideas or suggestions are welcome.
>
> Best regards.
> Romain.
>
> ---
> Ce courrier électronique ne contient aucun virus ou logiciel malveillant parce que la protection avast! Antivirus est active.
> http://www.avast.com
>
> _______________________________________________
> adegenet-forum mailing list
> adegenet-forum at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum


---
Ce courrier électronique ne contient aucun virus ou logiciel malveillant parce que la protection avast! Antivirus est active.
http://www.avast.com



More information about the adegenet-forum mailing list