Created
June 2, 2022 08:26
-
-
Save ms609/ba78b1dd41aa8f2fd7f25d415588e18f to your computer and use it in GitHub Desktop.
Revisions
-
ms609 renamed this gist
Jun 2, 2022 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
ms609 created this gist
Jun 2, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ poEdge <- Postorder(tree())$edge parent <- poEdge[, 1] child <- poEdge[, 2] xy <- matrix(0, parent[1], 2) xy[seq_len(NTip(tree())), ] <- mapping() for (node in unique(parent)) { xy[node, ] <- colMeans(xy[child[parent == node], , drop = FALSE]) } segments(xy[parent, 1], xy[parent, 2], xy[child, 1], xy[child, 2], col = "#00000033") points(xy[parent, 1], xy[parent, 2], pch = ".", col = "#00000099")