ape 包 - 打印生成的树

ape package - print generated tree

我正在使用 R 中的 ape 包来生成系统发育树。我想以 png 格式打印生成的树,以便我可以将图像通过管道传输到网站。我似乎找不到打印生成的树的命令(如果可能的话)。有些 advice/insight 将不胜感激。

听起来您正在为树(class "phylo" 的对象)寻找 绘图方法,例如:

library(ape)
tt <- rcoal(10)
png("phylo1.png")
plot(tt)
dev.off()

?plot.phylo 提供了有关自定义绘图的许多选项的信息。

有更多的绘图选项,例如来自 vignette for the phylogram package:

Publication-quality trees can be generated from dendrogram objects using the stats plotting function plot.dendrogram, and the extensive plotting functions available in a dendrogram-enhancing packages such as circlize (Z. Gu et al. 2014) and dendextend (Galili 2015). The latter also offers the facility to convert dendrograms to “ggdend” objects, for which many powerful ‘grammar of graphics’ plotting functions are available in the ggplot2 (Wickham 2009) and ggdendro (DeVries and Ripley 2016) packages. Moreover, there are several advanced plotting options for “phylo” objects in the ape package (E. Paradis, Claude, and Strimmer 2004), made accessible for dendrogram objects here via the Newick import/export functions read.dendrogram and write.dendrogram ...