For creating extra annotations on plots, it would be helpful to be able to access the x and y locations of nodes in a plotted tree. I think these are stored in node_x_coord_map and node_y_coord_map, so should be trivial to return.
One discrete way to to this would be to add an attribute (or method) to the SVGstring class that returned a dict of this data, e.g.
svg_string = ts.first().draw_svg()
positions = svg_string.positions
print(positions[node_id]) # prints tuple of (x, y)
I wonder if this is an abuse of the SVGstring class though, which is simply a subclass of the python String?
For creating extra annotations on plots, it would be helpful to be able to access the x and y locations of nodes in a plotted tree. I think these are stored in
node_x_coord_mapandnode_y_coord_map, so should be trivial to return.One discrete way to to this would be to add an attribute (or method) to the SVGstring class that returned a dict of this data, e.g.
I wonder if this is an abuse of the SVGstring class though, which is simply a subclass of the python String?