I found the solution to draw single-colored rooted trees (Butcher trees as used in numerical analysis) in Butcher Trees in TikZ
I would like to adapt this to colored trees with white and black nodes. So far, I am using the following adaptation of the code from the link above.
\documentclass{standalone}
% Butcher trees, cf. https://tex.stackexchange.com/questions/283343/butcher-trees-in-tikz
\usepackage{forest}
\forestset{
*/.style={
delay+={append={[]},}
},
rooted tree/.style={
for tree={
grow'=90,
parent anchor=center,
child anchor=center,
s sep=2.5pt,
if level=0{
baseline
}{},
delay={
if content={*}{
content=,
append={[]}
}{}
}
},
before typesetting nodes={
for tree={
circle,
fill,
minimum width=3pt,
inner sep=0pt,
child anchor=center,
},
},
before computing xy={
for tree={
l=5pt,
}
}
},
white node/.style={
circle, fill=white, draw=black, thick,
},
}
\DeclareDocumentCommand\rootedtree{o}{\Forest{rooted tree [#1]}}
\begin{document}
\rootedtree[]
\rootedtree[[]]
\rootedtree[.,white node]
\rootedtree[.,white node[]]
\rootedtree[[.,white node]]
\end{document}
This gives
I have two questions:
- How can I get rid of the small black dots in the "white nodes"?
- How can I let the edges end at the outer circles?