tree <- BalancedTree(1:8) + PectinateTree(9:14)
tree <- ape::bind.tree(BalancedTree(1:8), PectinateTree(9:12), 8, 4)
paint <- PaintTree(tree)
plot(tree,
edge.color = paint$edgeCol,
tip.color = paint$tipCol,
edge.width = 3)
# Colour-blind-safe variants
paintP <- PaintTree(tree, "protanopia")
plot(tree,
edge.color = paintP$edgeCol,
tip.color = paintP$tipCol,
edge.width = 3)
paintT <- PaintTree(tree, "tritanopia")
plot(tree,
edge.color = paintT$edgeCol,
tip.color = paintT$tipCol,
edge.width = 3)
# User-supplied palette function (greyscale)
grey_pal <- function(h, s) grey(1 - s * 0.8)
paintG <- PaintTree(tree, grey_pal)
plot(tree, edge.color = paintG$edgeCol, edge.width = 3)
Run the code above in your browser using DataLab