0

I have tried to use the solution given in how to draw skewed (unbalanced) tree with tikz-qtree? answer but I am getting error.

Undefined control sequence. \edge[draw=none];

My code is

\Tree[.{Collection(I) \\ $1.2$ V} 
                    \edge[draw=none];  
                    [.Queue(I) 
                        [.PriorityQueue 
                        ]
                        [.{BlockingQueue}
                            [.PriorityBlockingQueue 
                            ]
                            [.LinkedBlockingQueue 
                            ] 
                        ]
                    ] 
            ]

I am trying to achieve this diagram

Collection

Also I want curvy line around some nodes with text written beside it and dots like \cdots to represents more nodes in tree. Help.

1 Answer 1

1

Welcome! Maybe a cloud shape can do? I also recommend forest, this answer uses some tricks from here.

\documentclass{article}
\usepackage[edges]{forest}
\usetikzlibrary{shapes.symbols}
\begin{document}
\noindent\begin{forest}
forked edges,
for tree={}
[{Queue (I)},alias=root
 [PriorityQueue,alias=L
 ]
 [BlockingQueue,for tree={folder, grow'=0}
  [PriorityBlockingQueue ]
  [LinkedBlockingQueue,alias=B]
 ]
 [\dots,alias=R]
]
\draw (root) -- ++ (120:2.4) 
    node[above,label={[anchor=north east,font=\small,magenta]south east:$1.2$ V}] {Collection(I)};
\node[cloud,draw,fit=(L)(R)(B)(root),inner sep=0pt,aspect=2,cloud puffs=42,
label={[anchor=south west,font=\small,magenta]north east:$1.5$ V}]{};
\end{forest}
\end{document}

enter image description here

BTW, if 1.2 V are Volts, maybe you want to use siunitx.

1
  • Thanks a lot. I am a newbie and I appreciate this great help. This is exactly what I wanted. Commented Dec 29, 2019 at 8:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .