plot_tree#
- plot_tree(node, ax=None, *, columns_names: list | None = None, class_names: list | None = None, scaler=None, float_precision: int | None = 3, max_depth: int | None = None, node_ids: bool = True, samples: bool = True, filled: bool = True, fontsize: float | None = None, colors: dict | None = None, wrap: int | None = None, show_media: bool = False)[source]#
Draw the subtree of a node with matplotlib. See
RuleTree.plot_treefor the parameters.- Returns:
ax – The axes of the drawing. Each box is a text of
ax.textswhose gid is the id of its node ("(...)"for the subtrees cut bymax_depth); each medium is an axes ofax.child_axeswhose gid ismedia-<node id>-<position>(trueorfalseon the arrows).- Return type:
matplotlib.axes.Axes