--
G Yu, DK Smith, H Zhu, Y Guan, TTY Lam*. ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data, Methods in Ecology and Evolution, 2017, 8(1):28-36. doi:10.1111/2041-210X.12628
Homepage: https://guangchuangyu.github.io/ggtree
---
You received this message because you are subscribed to the Google Groups "ggtree" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bioc-ggtree+unsubscribe@googlegroups.com.
To post to this group, send email to bioc-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bioc-ggtree/cc725508-67ab-4e43-84b0-04718328a6b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On Fri, Jun 16, 2017 at 6:01 PM, Frederik Bak <fba...@gmail.com> wrote:
Hi,I am trying to plot a tree where some of the tip labels are supposed to be bold and some are to be italic.I have read this: https://guangchuangyu.github.io/ggtree/faq/#formatting-tip-labels but it is still a bit unclear to me.I have thought about two ways to do it. One is:ggtree(phyloseqobject)+ geom_tiplab(aes(label=Name), align = TRUE, linetype = 0, offset = 0.04) + geom_text2(aes(label = label, fontface = "italic", subset=node %in% Mylist))+geom_text2(aes(label=label, fontface = "bold", subset = node %in% Mylist2))Obviously, this plots the label names twice. I could off course skip the geom_tiplab part, but I really like the alignment which is made here.Another way could be something like:I have not included the bold part in this one, but I assume it would just be adding another "+geom_tiplab(xxx)" afterwards?ggtree(phyloseqobject) + geom_tiplab(aes(subset = node %in% Mylist),label=substitute(italic(x),list(x=c(1:20)[1])), parse=T, align = TRUE, linetype = 0, offset = 0.04)Here I get this error:Warning: Ignoring unknown parameters: label, parseError: Aesthetics must be either length 1 or the same as the data (20): label, hjustMylist has the length 20 which is why I wrote c(1:20) (could has well been a vector with 20 labels). I do not know why this error occurs.I think the latter option is the preferable one, in order to keep the alignment, but I need to be able to overcome the error.Frederik
--
G Yu, DK Smith, H Zhu, Y Guan, TTY Lam*. ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data, Methods in Ecology and Evolution, 2017, 8(1):28-36. doi:10.1111/2041-210X.12628
Homepage: https://guangchuangyu.github.io/ggtree
---
You received this message because you are subscribed to the Google Groups "ggtree" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bioc-ggtree...@googlegroups.com.
To post to this group, send email to bioc-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bioc-ggtree/cc725508-67ab-4e43-84b0-04718328a6b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
pls try fontface='bold.italic'
.
---
You received this message because you are subscribed to the Google Groups "ggtree" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bioc-ggtree+unsubscribe@googlegroups.com.
To post to this group, send email to bioc-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bioc-ggtree/7c8f27c4-1b93-4a03-8c4f-5643dd92a852%40googlegroups.com.