Hi Martin,
The below code might help you.

require(phytools)
tree<-pbtree(n=100) # simulate tree
s<-sample(c(0,1),100,replace = T) # create character state
names(s)<-tree$tip.label # assign tip labels to character state
mtreel<-make.simmap(tree,s,nsim=10)
XX <- densityMap(mtreel, lwd = 2,ftype="off")
s<-colorRampPalette(c("green","red")) # change the colors here
XX$cols[]<-s(length(XX$cols))
plot(XX, lwd = 2,ftype="off",outline=FALSE)

Regards,
Gopal Murali

---------------------------------------------------------------------

*“**How strange is the lot of us mortals! Each of us is here for a brief
sojourn; for what purpose he knows not, though he sometimes thinks he
senses it. But without deeper reflection one knows from daily life that one
exists for other people…a hundred times every day I remind myself that my
inner and outer life are based on the labors of other men, living and dead,
and that I must exert myself in order to give in the same measure as I have
received and am still receiving,”*
― Albert Einstein
<http://www.goodreads.com/author/show/9810.Albert_Einstein>
-------------------------------------------------------------------------------------


On Wed, Sep 26, 2018 at 5:36 PM <rami...@macn.gov.ar> wrote:

> Hello,
>
> I want to change the colors of a Bayesian stochastic mapping, using
> make.simmap (e.g., switching blue and red). Is it possible?
>
> (I tried switching the order of the columns of the states -- no effect.)
>
> Thanks for any help!
>
> Martin Ramirez
>
> _______________________________________________
> 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/

Reply via email to