1

I was wondering how I can add an arrow coming from the circled region as shown in Tikz and also adding some text to the end of the arrow . Here is what I have so far

\usetikzlibrary{backgrounds}
\begin{document}

\begin{tikzpicture}[halo/.style={line join=round,
 double,line cap=round,double distance=#1,shorten >=-#1/2,shorten <=-#1/2},
 halo/.default=7mm]
    \node[circle,draw,fill=gray](s){s}
        child{node[circle,draw,fill=white]{}
             child{node[circle,draw,fill=gray]{}}
        }
        child{node[circle,draw,fill=white]{}
             child{node[circle,draw,fill=gray]{}}
        }
        child{node[circle,draw,fill=white](R1){}
            child{node[circle,draw,fill=gray](R2){}}
        };
 \begin{scope}[on background layer]     
  \draw[halo] (s) -- (R1.center) -- (R2);       
 \end{scope}
 \path (R2.south) ++ (0,-3.5mm); % shorten does not get taken into account by the bounding box
\end{tikzpicture}
\end{document}

tree

2

Like this?

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{backgrounds,calc}
\begin{document}

\begin{tikzpicture}[halo/.style={line join=round,
 double,line cap=round,double distance=#1,shorten >=-#1/2,shorten <=-#1/2},
 halo/.default=7mm]
    \node[circle,draw,fill=gray](s){s}
        child{node[circle,draw,fill=white]{}
             child{node[circle,draw,fill=gray]{}}
        }
        child{node[circle,draw,fill=white]{}
             child{node[circle,draw,fill=gray]{}}
        }
        child{node[circle,draw,fill=white](R1){}
            child{node[circle,draw,fill=gray](R2){}}
        };
 \begin{scope}[on background layer]     
  \draw[halo] (s) -- (R1.center) coordinate[pos=0.8] (tip) -- (R2);       
 \end{scope}
 \path (R2.south) ++ (0,-3.5mm); % shorten does not get taken into account by the bounding box
 \draw[stealth-] ($ (tip)!3.5mm!-90:(s) $) to[bend right=20]
 ($ (tip)!1.2cm!-90:(s) $) node[above]{text};
\end{tikzpicture}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.