eaton-lab / toytree

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

implement text markers for nodes #3

Closed dereneaton closed 7 years ago

dereneaton commented 7 years ago

Replace markers in node labels with marker objects like below. This can also allow better separation of nodes, node-labels, and node-hovering, which might require some changes to the user arguments.

import toyplot.marker
marker_a = toyplot.marker.create(shape="|", angle=45)
marker_b = toyplot.marker.create(shape="o", label="A", lstyle={"fill":"white"})
canvas = toyplot.Canvas(600, 300)
canvas.cartesian(grid=(1, 2, 0)).scatterplot(y, marker=marker_a, size=10)
canvas.cartesian(grid=(1, 2, 1)).scatterplot(y, marker=marker_b, size=15);