I would like to "animate" a growing tree. This means that the nodes and edges in trees (a)-(c) should be aligned like the final tree.
Unfortunately I couldn't figure out how to do this with the forest package or in general (other than drawing everything "by hand" with tikz).
The code used for generating the falsely aligned picture is:
\documentclass{article}
\usepackage{tikz}
\usepackage{subcaption}
\usepackage[linguistics]{forest}
\begin{document}
\begin{figure}
\centering
\subcaptionbox[Tree]{
Tree
\label{subfig:sublabel1}%
}
[0.3\textwidth]
{%
\begin{forest}for tree={inner sep=0pt,outer sep=0pt, s sep=(2-level)*2mm, l=(8-level*level*level)*0.1mm}
[,s sep=30
[1
[1]
]
]
\end{forest}}
\hspace{0.1\textwidth}
\subcaptionbox[Tree]{
Tree
\label{subfig:sublabel1}%
}
[0.3\textwidth]{
\begin{forest}for tree={inner sep=0pt,outer sep=0pt, s sep=(2-level)*2mm, l=(8-level*level*level)*0.1mm}
[,s sep=30
[1
[1][0][1]
]
]
\end{forest}}
\subcaptionbox[Tree]{
Tree
\label{subfig:sublabel1}%
}
[0.3\textwidth]{
\begin{forest}for tree={inner sep=0pt,outer sep=0pt, s sep=(2-level)*2mm, l=(8-level*level*level)*0.1mm}
[,s sep=30
[1
[1][0][1][0]
]
[1
[0][1]
]
]
\end{forest}
}
\hspace{0.1\textwidth}
\subcaptionbox[Tree]{
Tree
\label{subfig:sublabel1}%
}
[0.3\textwidth]{
\begin{forest}for tree={inner sep=0pt,outer sep=0pt, s sep=(2-level)*2mm, l=(8-level*level*level)*0.1mm}
[,s sep=30
[1
[1][0][1][0]
]
[1
[0][1][0][0]
]
[0]
[1
[1][0][0][0]
]
]
\end{forest}
}
\end{figure}
\end{document}
Edit: I found similar questions regarding Beamer and tried to craft a solution based on the code given by Qrrbrbirlbel, so far to no avail:
I tried:
\tikzset{
invisible/.style={opacity=0,text opacity=0},
}
\forestset{
invisible/.style={
for tree={
/tikz/invisible,
edge={/tikz/invisible}}}}
and specified ,for children={invisible}
after a node, unfortunately nothing happens.
phantom
instead ofinvisible
.