我想用 TeX 代码创建如下所示的树形图(使用1 级...3 级在树状图旁边)。另外,我想知道如何将项目符号放在框下。例如,3 级代替最大尺寸,铸造复杂性等等...我希望它以项目符号的形式列出产品开发能力。
如能提供任何帮助,我们将非常感激。
答案1
仅供参考,这棵树是使用强大的forest
包装;注意代码中的经济性:
\documentclass[border=5pt]{standalone}
\usepackage{forest}
\begin{document}
\begin{forest}
for tree={
draw,
minimum height=2cm,
anchor=north,
align=center,
child anchor=north
},
[{Supplier\\Selection}, align=center, name=SS
[{Production\\Development\\Capability}, name=PDC
[Max Size, name=MS]
[{Casting\\Complexity}]
[{Min. Sec.\\Thickness}]
[{Software\\ Aid}]
[{Pattern\\Making}]
]
[{Manufacturing\\Capability}]
[{Quality\\Capability}]
[{Cost and \\Time}
[{Total\\Costing\\Cost}]
[{Sample\\Delivery\\Time}]
]
]
\node[anchor=west,align=left]
at ([xshift=-2cm]MS.west) {Level 3\\Criteria};
\node[anchor=west,align=left]
at ([xshift=-2cm]MS.west|-PDC) {Level 2\\ Group Criteria};
\node[anchor=west,align=left]
at ([xshift=-2cm]MS.west|-SS) {Level 1\\Overall Objective};
\end{forest}
\end{document}
答案2
这是一个可能的解决方案
注意:如果更喜欢箭头线,请添加样式,\tikzset{...}
如下所示。
edge from parent/.style={draw=black!70,-latex}
代码:
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{trees}
\begin{document}
\begin{tikzpicture}
[auto,every node/.style={rectangle,draw, text centered, text width=2.2cm,minimum height=1.5cm },node distance=6cm]
\tikzset{%
level 1/.style={sibling distance = 5cm, level distance=2cm,edge from parent path={(\tikzparentnode.south) -- (\tikzchildnode.north)}},
level 2/.style={sibling distance = 2.5cm,level distance=3cm}
}
\node (0){Supplier \\ Selection}
child {node (1) {Production \\ Development \\Capability}
child {node (2) {Max sixe}}
child {node {Casting\\Complexity}}
child {node {Min. Sec.\\Thickness}}
child {node {Software\\Aid}}
child {node {Pattern\\Making}}}
child {node {Manufacturing\\Capability}}
child {node {Quality\\Capabiltity}}
child {node {Cost and\\Time}
child {node {Total\\ Casting\\ Cost}}
child {node {Sample\\Delivery\\Time}}};
\node at (0) [xshift=-11cm,left,draw=none]{Level 1};
\node at (1) [xshift=-6cm, left,draw=none]{Level 2};
\node at (2) [xshift=-1cm, left,draw=none]{Level 3};
\end{tikzpicture}
\end{document}