set.seed(9999)
# Create random topology with random node numbering
phy1 <- rtopology(10)
# Impose 'canonical' node numbering
phy2 <- fixNodes(phy1)
# Compare node numbering schemes
op = par(no.readonly = TRUE)
par(mfcol = c(1, 2), mar = c(0, 0, 3, 0))
plot(phy1, use.edge.length = FALSE, show.tip.label = FALSE)
nodelabels(); tiplabels()
title("random node numbers")
plot(phy2, use.edge.length = FALSE, show.tip.label = FALSE)
nodelabels(); tiplabels()
title("preorder traversal of internal nodes")
par(op)
Run the code above in your browser using DataLab