我如何创建下面的决策树?

我如何创建下面的决策树?

有人能帮我画出这个图吗?我需要将它添加到 Latex 文档中,但我不知道如何正确使用函数。在此处输入图片描述

答案1

作为起点forest

在此处输入图片描述

节点中的文本、节点大小和样式应该适合您的需求/品味。

\documentclass[margin=5mm]{standalone}
\usepackage[utf8]{inputenc}
\usepackage[edges]{forest}

    \begin{document}
%%%%    uvod-5
\linespread{0.9}
   \begin{forest}
    for tree={% style of tree nodes
        text width = 22mm, text badly centered,
              % style of tree (edges, distances, direction)
             edge = {draw, semithick, -stealth},
           anchor = north,
             grow = south,
    forked edge,            % for forked edge
            s sep = 2mm,    %
            l sep = 4mm,    %
         fork sep = 2mm,    % distance from parent to branching point
         tier/.option=level,
               }
[text
    [no
        [text]
    ]
    [yes
        [text text
            [text text text
                [text
                    [text]
                ]
                [text
                    [text]
                    ]
                ]
            ]
        ]
    ]
    ]
    \end{forest}
\end{document}

相关内容