Is it possible to change this MWE which is using forest package to produce a tree, similar to that produced by the next MWE that is not using forest? The very last level of child nodes would have to be stacked on top of each other with edge drawn from the south
of the parent to the west
of the child.
After reading the Forest manual, I got an impression that the key where n children=0
should be able to help, and added the line with the comment, but no matter what grow
parameter I supplied, such as north/south, or 0-45-90-120 etc, the direction of growth did not change.
The solution probably lies in the pp. 10-12 of the Forest manual, but it is evading me :(
\documentclass{article}
\usepackage{forest}
\begin{document}
\begin{forest}
for tree={
where n children=0{draw=red,grow=120}{}, %<============
edge path={
\noexpand\path[\forestoption{edge}]
(!u.parent anchor) -- +(0,-15pt) -|
(.child anchor)\forestoption{edge label};
},
l sep=10pt,
}
[P
[N1
[N1C1]
[N1C2]
]
[N2
[N2C1]
[N2C2]
]
]
\end{forest}
\end{document}
Without forest (the lowest level edge is different and the nodes are stacked):
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{trees}
\begin{document}
\begin{tikzpicture}[
children/.style={grow=down,xshift=-0.2cm,
edge from parent path={(\tikzparentnode.201) |- (\tikzchildnode.west)}
},
level1/.style ={level distance=4em,anchor=west},
level2/.style ={level distance=8em,anchor=west},
level 1/.style={edge from parent fork down,sibling distance=5em,level distance=4em
}
]
\node[anchor=south](super){P}[]
child{node {N1}
child[children,level1] {node {N1C1}}
child[children,level2] {node {N1C2}}
}
child{node {N2}
child[children,level1] {node {N2C1}}
child[children,level2] {node {N2C2}}};
\end{tikzpicture}
\end{document}
edit
button at the bottom left of your post. (Editing will put your question back on the front page in the same way as asking a new question.)