eaton-lab / toytree

A minimalist tree plotting library using toyplot graphs
http://eaton-lab.org/toytree
BSD 3-Clause "New" or "Revised" License
165 stars 28 forks source link

add matrix to tree view #27

Closed phiweger closed 4 years ago

phiweger commented 4 years ago

hi, awesome library!

is it possible to place a feature matrix next to the tree, like the barplot in the tutorial?

kind regards

eaton-lab commented 4 years ago

Thanks @phiweger! I added a new section to the Cookbook gallery with some examples: https://toytree.readthedocs.io/en/latest/Cookbook.html#7.-Plot-tree-with-matrix/heatmap

phiweger commented 4 years ago

@eaton-lab thanks a lot! I have a question on this:

here you show how to add a random matrix; but how to add tip-specific features?

for example, say I have a tree w/ 3 tips (A, B, C) and some features {A: 1, B: 3, C: 2.4} -- is there a way to add the matrix without "looping through the coordinates" and adding the features manually?