latex画二叉树,圆圈大小保持一致
2026/6/13 10:07:21 网站建设 项目流程
\begin{tikzpicture}[ level 1/.style={sibling distance=2.6cm, level distance=0.8cm}, % 第1层子节点之间水平间距2.6cm,第一层和第二层之间高度1cm level 2/.style={sibling distance=1.6cm, level distance=0.8cm}, % 第2层子节点间距 line width=0.6pt, %连线的线条粗细 every node/.style={ circle, draw, % minimum size=1.5em, minimum size=1.7em, % 固定最小/最大尺寸(关键:加maximum size) % maximum size=1.5em, % 强制节点不随文字变长变大 line width=0.7pt, %圆圈线条粗细 % inner sep=2.5pt, inner sep=0pt, % 取消内边距(避免文字挤大节点) align=center, % 文字居中(若有换行也不影响尺寸) font=\scriptsize } ] \node {\small 61} child { node {\small 34} child { node {\small 9} child[edge from parent/.style={draw=none}] { coordinate {} } child { node {\small 15} } } child { node {\small 44} child[edge from parent/.style={draw=none}] { coordinate {} } child { node {\small 41} } } } child { node {\small 99} child { node {\small 73} child[edge from parent/.style={draw=none}] { coordinate {} } child { node {\small 85} } } child { node {\small 102} child[edge from parent/.style={draw=none}] { coordinate {} } child { node {\small 112} } } }; \end{tikzpicture}

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询