legend a phylogenetic tree

R programming language resources Forums Data manipulation legend a phylogenetic tree

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #896
    andreiar
    Member

    hi guys

    im new with R and im stuck here with little thing … make a simple legend :s

    i want to put a legend on bottom right of page (tiff format) with title “Equinodermata Classes” and identifying the classes (the names with different colours that i already have in my phylogenetic tree). So the Asteroidea its one classe and i want write this word in blue because the leaves of my tree in green are from Asteroidea, with same case Echinoidea but in red …

    im trying to do like this:

    <code>

    classes <- c(“Classe Holothuroidea”, “Classe Asteroidea”)

    for (i in classes) {

    if (i==”Classe Holothuroidea”) text.col =”green”

    if (i==”Classe Asteroidea”) text.col =”blue”

    {

     

    plot.phylo (ATP8, show.node.label=TRUE, tip.color = my_tip_color, use.edge.length = TRUE, font = 2, edge.width=2, x.lim =6.0, y.lim=29, cex=0.6)

    legend(“bottomright”, legend = c(“Classe Asteroidea”, “Echinoidea”, “Classe Holothuroidea”, “Ophiuroidea”),title = “Equinodermata Classes”, text.col = my_tip_color, cex=0.7)

    classes <- c(“Classe Holothuroidea”, “Classe Asteroidea”)

    for (i in classes) {

    if (i==”Classe Holothuroidea”) text.col =”green”

    if (i==”Classe Asteroidea”) text.col =”blue”

    {

    tiff(“atp8_treeingroup.tif”, compression = “lzw”)

     

    plot.phylo (ATP8, show.node.label=TRUE, tip.color = my_tip_color, use.edge.length = TRUE, font = 2, edge.width=2, x.lim =6.0, y.lim=29, cex=0.6)

     

    mtext (“ATP8 TREE – ingroup”, side = 3, font = 2, adj = 1, cex=1.0)

     

    legend(“bottomright”, legend = c(“Classe Asteroidea”, “Echinoidea”, “Classe Holothuroidea”, “Ophiuroidea”),title = “Equinodermata Classes”, text.col = classes, cex=0.7)

    </code>

    The problem is .. i get the legend in green (all even the title) … can you help me with this?

     

    thanks 🙂

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.
Scroll to top
Privacy Policy