def __recursive_display_Tree(self, node, pos, parent_pos): node_text = str(node) node_type = PlotUtil.nodestyle_leaf if node.isLeaf( ) else PlotUtil.nodestyle_internal _w_p, _ = node.calc_Treesize() # draw left child if node.get_Left() is not None: node_left = node.get_Left() _w_l, _ = node_left.calc_Treesize() x_l = pos[0] - _w_p * PlotUtil.pos_xoffset / 2.0 pos_child = ((x_l + _w_l * PlotUtil.pos_xoffset / 2.0), pos[1] - PlotUtil.pos_yoffset) self.__recursive_display_Tree(node_left, pos_child, parent_pos=pos) if node.get_Right() is not None: node_right = node.get_Right() _w_r, _ = node_right.calc_Treesize() x_r = pos[0] + _w_p * PlotUtil.pos_xoffset / 2.0 pos_child = ((x_r - _w_r * PlotUtil.pos_xoffset / 2.0), pos[1] - PlotUtil.pos_yoffset) self.__recursive_display_Tree(node_right, pos_child, parent_pos=pos) # draw myself PlotUtil.draw_Node(node_text, pos, parent_pos, node_type)