
私は、tikz-qtree を使用して歪んだ (不均衡な) ツリーを描画する方法は?回答しましたが、エラーが発生します。
未定義の制御シーケンス。\edge[draw=none];
私のコードは
\Tree[.{Collection(I) \\ $1.2$ V}
\edge[draw=none];
[.Queue(I)
[.PriorityQueue
]
[.{BlockingQueue}
[.PriorityBlockingQueue
]
[.LinkedBlockingQueue
]
]
]
]
私はこの図を実現しようとしている
また、いくつかのノードの周りに曲線を描き、その横にテキストを書き込み、ツリー内の他のノードを表すために \cdots のようなドットを配置したいです。助けてください。
答え1
ようこそ!雲の形でもできるでしょうか?私もお勧めしますforest
、この答えはいくつかのトリックを使用していますここ。
\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}
ちなみに、1.2 V
Volts の場合は、 を使用するとよいでしょうsiunitx
。