I'm trying to connect the ends of child nodes in TikZ. The lines form the correct shape (it should look like a triangle), but they are appearing weirdly displaced. I want the lines to connect the nodes, not appear way out from the graph.
When I comment out the \tikz line, it seems to resolve the problem. Why is this? How can I fix it while keeping it formatted like this?
\begin{tikzpicture}
\tikzstyle{level 1}=[sibling angle=120]
\tikzstyle{level 2}=[sibling angle=60]
\tikzstyle{level 3}=[sibling angle=30]
\tikzstyle{every node}=[fill]
\tikz [grow cyclic,shape=circle,very thick,level distance=13mm,cap=round]
\node (root) {} child [color=\A, name = \A] foreach \A in {red,green,blue}
{ node {} child [color=\A!50!\B] foreach \B in {red,green,blue}
{ node {}
}
};
\draw (root-1-1) -- (root-1-2) -- (root-1-3) -- (root-1-1);
\end{tikzpicture}

tikzpictures(\tikz ...;is the same as\begin{tikzpicture}...;\end{tikzpicture}) https://tex.stackexchange.com/a/66037/38080 – Rmano Feb 11 '21 at 07:22