![我需要在 LaTeX 中制作树状图](https://linux22.com/image/357190/%E6%88%91%E9%9C%80%E8%A6%81%E5%9C%A8%20LaTeX%20%E4%B8%AD%E5%88%B6%E4%BD%9C%E6%A0%91%E7%8A%B6%E5%9B%BE.png)
答案1
或者是其他东西 ...
你知道 R 和针织品?
\documentclass{article}
\begin{document}
A dendrogram in a \LaTeXe{} document:\par
<<echo=F>>=
plot(as.dendrogram(hclust(dist(mtcars))))
@
\end{document}
答案2
\documentclass[11pt]{article}
\usepackage{pstricks,pst-node,pst-tree}
\usepackage[left=0.25in,right=0.25in,top=0.75in,bottom=0.75in]{geometry}
\usepackage{lscape}
\pagestyle{empty}
\begin{document}
\begin{center}
\leavevmode
\psset{linecolor=black,tnsep=2pt,tnheight=0cm,treesep=.3cm,levelsep=46pt,
radius=10pt}
\pstree{\Tcircle{ 1 }~[tnpos=l]{\shortstack[r]{ketenagakerjaan \\$\leq$ 65.41 }}}{
\Tcircle[fillcolor=red,fillstyle=solid]{ 2 }~[tnpos=l]{ 30}~{\shortstack{\texttt{1}\\0.43}}
\Tcircle[fillcolor=green,fillstyle=solid]{ 3 }~[tnpos=l]{ 36}~{\shortstack{\texttt{0}\\0.14}}
}
\end{center}
{A CRUISE tree.
The split rule is given beside each intermediate node.
The predicted class and misclassification costs are given beneath each terminal node,
and the number of learning samples is on its left.}
\end{document}