I read many examples in tikz-qtree, but I didn't find one which illustrates how to add text around/below a node using qtree. Anyone knows how to draw the following tree using tikz-qtree?

how to draw this


Here's one way to do this:

every tree node/.style={align=center,anchor=north,draw,circle,inner sep=3pt},
sibling distance=2cm,
edge from parent/.style=
     {draw, edge from parent path={(\tikzparentnode) -- (\tikzchildnode)}},

\Tree [.{}  \node[myleaf=A]{}; [.{} \node[myleaf=B]{};  \node[myleaf=C]{}; ]]


output of code

| improve this answer | |

I know that the OP asked specifically for tikz-qtree but, just in case, here's one possibility showing the approach using the powerful forest package:


for tree={
  nodes={anchor=north,draw,circle,inner sep=3pt},
  s sep=2cm
[ [,myleaf={a}] [ [,myleaf={b}] [,myleaf={c}] ] ]


enter image description here

| improve this answer | |

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.