PhyloTree.expected_fig_size

PhyloTree.expected_fig_size#

missionbio.plotting.phylotree.PhyloTree.expected_fig_size

PhyloTree.expected_fig_size(positions: Optional[ndarray] = None, text_sizes: Optional[ndarray] = None, marker_sizes: Optional[ndarray] = None, margin: float = 50, root: bool = True, layout: str = 'compact', compress: bool = True) Tuple[float, float]#

Estimate the plot size required to fit the tree.

Parameters:
positionsOptional[np.ndarray]

The position obtained from _estimate_node_positions. If this is not given, it is calculated using _estimate_node_positions

text_sizesOptional[np.ndarray]

The text_sizes obtained from _estimate_node_positions. If this is not given, it is calculated using _estimate_node_positions

marker_sizesOptional[np.ndarray]

The size of the markers at each coordinate. See _estimate_node_positions for details. If it is not given, it is calculated using _estimate_node_positions

marginfloat

The go.Figure.layout.margin value for all sides.

rootbool

Whether the root node should be included in the plot. If False, the root, and any edge connecting to the root are not drawn. The figure width will be smaller without the root.

layout: str

One of [“compact”, “depth-first”]. See PhyloTree.draw for more details.

compress: bool

Whether to compress the tree in the y direction.

Returns:
width, height:

The expected size of the figure to fit all the nodes and description for the given font_size, marker_size, margin, and marker_gap.


< Class PhyloTree