
次のような qtree があるとします。
\documentclass{article}
\usepackage{tikz}
\usepackage{tikz-qtree,tikz-qtree-compat}
\begin{document}
\begin{tikzpicture}
\tikzset{
% Define arrow style
pil/.style={
->,
thick,
shorten <=2pt,
shorten >=2pt,},
edge from parent/.style={draw, edge from parent path={(\tikzparentnode.south)
-- +(0,-8pt)
-| (\tikzchildnode)}},
level 1/.style={sibling distance=0.5cm}
}
\Tree
[.{1}
[.1-1 ]
[.1-2 ]
[.1-3
[.1-3-1 ]
[.1-3-2 ]
[.1-3-3 ]
[.1-3-4 ]
]
[.1-4 ]
[.1-5 ]
]
\end{tikzpicture}
\end{document}
ノード 1-2 と 1-4 を 1-3 に近づけることは可能ですか?
1 ~ 3 個のサブツリーを垂直方向に成長させて、次のような結果を得ることは可能ですか。
垂直にも水平にも成長できることはわかっていますqtrees
。しかし、ハイブリッドツリーを作成するにはどうすればよいでしょうか?
答え1
plainTikZ
とそのtrees
ライブラリを使用すると、次のような可能性が考えられます。
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{trees,positioning}
\begin{document}
\begin{tikzpicture}[edge from parent fork down,node distance=0.5cm,sibling distance=1cm]
\node {1}
child {node {1-1}}
child {node {1-2}}
child {node (13) {1-3}}
child {node {1-4}}
child {node {1-5}}
;
\node [below = of 13, xshift=30pt] (131) {1-3-1};
\node [below = of 131] (132) {1-3-2};
\node [below = of 132] (133) {1-3-3};
\node [below = of 133] (134) {1-3-4};
\foreach \value in {1,...,4}
\draw (13.south) |- (13\value.west);
\end{tikzpicture}
\end{document}