
我嘗試使用中給出的解決方案如何用 tikz-qtree 繪製傾斜(不平衡)樹?回答但我收到錯誤。
未定義的控制序列。 \edge[繪製=無];
我的程式碼是
\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
是伏特,也許你想使用siunitx
。