如何在整个树中实现统一的边缘路径,类似于从根到直接子节点的路径?也就是说,这里要有尖角而不是弯角。另外,分离每个级别的兄弟距离和级别距离的最佳方法是什么?
\documentclass{article}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{trees,positioning,shapes,shadows,arrows}
\begin{document}
\tikzset{
edge from parent/.style={-latex,solid,black,thick,sloped,draw},
edge from parent path={(\tikzparentnode.east) -- (\tikzchildnode.west);},
edge from parent fork down
}
\begin{figure}
\centering
\begin{tikzpicture}[
basic/.style = {draw, text width=5cm, drop shadow, font=\sffamily, rectangle},
root/.style = {basic, rounded corners=2pt, thin, align=center, fill=white},
level 1/.style={},
level 2/.style={basic,rounded corners=4pt, thin,align=center, fill=white, text width=3cm},
level 3/.style={basic,rounded corners=6pt, thin,align=center, fill=white, text width=2cm},
level 4/.style={basic,rounded corners=6pt, thin,align=center, fill=white, text width=2cm,sibling distance=10em, level distance=10em}
]
% root of the the initial tree, level 1
\node[root] {\textbf{Root}} [sibling distance=25em, level distance=8em]
% The first level, as children of the initial tree
child {node[level 2] (c1) {\textbf{Child 1l}} [sibling distance=10em, level distance=6em]
child {node [level 3] (c11) {Granchild 1-1} [sibling distance=10em, level distance=7em]
child {node [level 4] (c111) {Dummy text}}}
child {node [level 3] (c12) {Granchild 1-2} [sibling distance=10em, level distance=7em]
child{node [level 4] (c121) {{Dummy text}}}
}
child {node [level 3] (c13) {Granchild 1-3} [sibling distance=10em, level distance=7em]
child{node [level 4] (c131) {{Dummy text}}}
}
}
child {node[level 2] (c2) {\textbf{Child 2}} [sibling distance=10em, level distance=6em]
child {node [level 3] (c21) {Grandchild 2-1} [sibling distance=10em, level distance=7em]
child {node [level 4] (c211) {{Dummy text}}}
}
child {node [level 3] (c22) {Grandchild 2-2} [sibling distance=10em, level distance=7em]
child {node [level 4] (c221) {{Dummy text}}}
}
};
\end{tikzpicture}
\caption{This is a simple Taxonomy}
\label{fig:my_label}
\end{figure}
\end{document}