Re: [R-sig-phylo] using color function in phylomorphospace

2019-04-01 Thread AMANDA M SALVI
I got it! And it looks lovely. Thanks so much Liam and Cecile.

Best,

Amanda

From: R-sig-phylo  on behalf of Liam Revell 

Sent: Saturday, March 9, 2019 9:42 AM
To: Cecile Ane; r-sig-phylo@r-project.org
Subject: Re: [R-sig-phylo] using color function in phylomorphospace

Cecile makes a good point. In this case if your tree has 36 edges all
you would have to do is change your code such that:

phylomorphospace(...,control=list(col.edge=setNames(1:36,tree$edge[,2])))

and you'll have the colors that correspond to the numeric vector 1:36.
(These are just the 8 colors of palette() repeated until you get to 36.)

For the purposes of painting different clades with different colors I
still recommend paintSubTree.

All the best, Liam

Liam J. Revell
Associate Professor, University of Massachusetts Boston
Profesor Asistente, Universidad Cat�lica de la Ssma Concepci�n
web: http://faculty.umb.edu/liam.revell/, http://www.phytools.org

Academic Director UMass Boston Chile Abroad (starting 2019):
https://www.umb.edu/academics/caps/international/biology_chile

On 3/9/2019 12:27 PM, Cecile Ane wrote:
> colors can be numeric. for example:
> plot(1:36, 1:36, col=1:36)
> C�cile
>
>> On Mar 8, 2019, at 8:42 PM, Liam Revell > <mailto:liam.rev...@umb.edu>> wrote:
>>
>> Dear Amanda.
>>
>> I'm a little confused by your code. If you want to use
>> control=list(col.edge) you need to set col.edge to a vector of colors,
>> but in your example col.edge is a numeric vector from 1 to 36.
>
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

[[alternative HTML version deleted]]

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


Re: [R-sig-phylo] using color function in phylomorphospace

2019-03-09 Thread Liam Revell
Cecile makes a good point. In this case if your tree has 36 edges all 
you would have to do is change your code such that:

phylomorphospace(...,control=list(col.edge=setNames(1:36,tree$edge[,2])))

and you'll have the colors that correspond to the numeric vector 1:36. 
(These are just the 8 colors of palette() repeated until you get to 36.)

For the purposes of painting different clades with different colors I 
still recommend paintSubTree.

All the best, Liam

Liam J. Revell
Associate Professor, University of Massachusetts Boston
Profesor Asistente, Universidad Católica de la Ssma Concepción
web: http://faculty.umb.edu/liam.revell/, http://www.phytools.org

Academic Director UMass Boston Chile Abroad (starting 2019):
https://www.umb.edu/academics/caps/international/biology_chile

On 3/9/2019 12:27 PM, Cecile Ane wrote:
> colors can be numeric. for example:
> plot(1:36, 1:36, col=1:36)
> Cécile
> 
>> On Mar 8, 2019, at 8:42 PM, Liam Revell > > wrote:
>>
>> Dear Amanda.
>>
>> I'm a little confused by your code. If you want to use
>> control=list(col.edge) you need to set col.edge to a vector of colors,
>> but in your example col.edge is a numeric vector from 1 to 36.
> 
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


Re: [R-sig-phylo] using color function in phylomorphospace

2019-03-09 Thread Cecile Ane
colors can be numeric. for example:
plot(1:36, 1:36, col=1:36)
Cécile

On Mar 8, 2019, at 8:42 PM, Liam Revell 
mailto:liam.rev...@umb.edu>> wrote:

Dear Amanda.

I'm a little confused by your code. If you want to use
control=list(col.edge) you need to set col.edge to a vector of colors,
but in your example col.edge is a numeric vector from 1 to 36.


[[alternative HTML version deleted]]

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


Re: [R-sig-phylo] using color function in phylomorphospace

2019-03-08 Thread Liam Revell
Dear Amanda.

I'm a little confused by your code. If you want to use 
control=list(col.edge) you need to set col.edge to a vector of colors, 
but in your example col.edge is a numeric vector from 1 to 36.

For your particular case, there is actually a much simpler way to set 
all the edges in a particular clade to be a specific color and that is 
by first 'painting' a set of states onto the tree using 
phytools::paintSubTree. This creates an object with a new class 
("simmap") and when phylomorphospace sees that object it will 
automatically paint the edges of each subtree with different colors.

It is very old, but you can see an example of this on my blog here: 
http://blog.phytools.org/2013/05/paintsubtree-doesnt-actually-paint-tree.html.

All the best, Liam

Liam J. Revell
Associate Professor, University of Massachusetts Boston
Profesor Asistente, Universidad Católica de la Ssma Concepción
web: http://faculty.umb.edu/liam.revell/, http://www.phytools.org

Academic Director UMass Boston Chile Abroad (starting 2019):
https://www.umb.edu/academics/caps/international/biology_chile

On 3/8/2019 5:36 PM, AMANDA M SALVI wrote:
> Hi all,
> 
> I'm having issues adding color onto a phylomorphospace plot. I want one 
> subgenera to be color 1 and the other subgenera to be color 2, so I can 
> more easily visualize how the two subgenera covariate across the plot.
> 
> What I've attempted:
> 
> phylomorphospace(tree,df[,c("PEp","P50")], control=list(col.edge=1:36, 
> lwd=2))
> 
> But that gives me a plot without any edges (see attached png).
> 
> Thanks,
> 
> Amanda Salvi
> 
> 
> 
> 
> ___
> R-sig-phylo mailing list - R-sig-phylo@r-project.org
> https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-phylodata=02%7C01%7Cliam.revell%40umb.edu%7C90755769f89d461f1a1d08d6a405d14c%7Cb97188711ee94425953c1ace1373eb38%7C0%7C1%7C636876742236592272sdata=OfAbbR4h1yd6WBvSwy1YThANe3HAX9U6PwZ0q8r0KRc%3Dreserved=0
> Searchable archive at 
> https://nam01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.mail-archive.com%2Fr-sig-phylo%40r-project.org%2Fdata=02%7C01%7Cliam.revell%40umb.edu%7C90755769f89d461f1a1d08d6a405d14c%7Cb97188711ee94425953c1ace1373eb38%7C0%7C1%7C636876742236592272sdata=1IKTCiV8USm5OuhKM1Ecoak%2B8v0ceTkHdlfSkmnZen8%3Dreserved=0
> 

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


[R-sig-phylo] using color function in phylomorphospace

2019-03-08 Thread AMANDA M SALVI
Hi all,

I'm having issues adding color onto a phylomorphospace plot. I want one 
subgenera to be color 1 and the other subgenera to be color 2, so I can more 
easily visualize how the two subgenera covariate across the plot.

What I've attempted:

phylomorphospace(tree,df[,c("PEp","P50")], control=list(col.edge=1:36, lwd=2))

But that gives me a plot without any edges (see attached png).

Thanks,

Amanda Salvi



___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/