tikz:移动节点

tikz:移动节点

我是 tikz 新手,所以任何建议都值得感激。我有以下树,但我需要 FP 节点与价格节点处于同一级别(垂直)。

\begin{tikzpicture} [level distance=10mm,
level 1/.style={sibling distance=32mm, edge from parent/.append style= {solid}},
level 2/.style={sibling distance=16mm, edge from parent/.append style={solid}},
%level 3/.style={sibling distance=8mm,level distance=12mm, edge from parent/.append style={solid}}, grow=right]

\scriptsize
\node {price}
child {node (one) {P}
}
child{node (two) {F}
child {node (down) {FP}
    }
};
\draw (one) -- (down);
\end{tikzpicture};

答案1

你的意思是这样的吗:

在此处输入图片描述

当然还有代码:

\begin{tikzpicture} [
    level distance = 12 mm,
  sibling distance = 32 mm,
                    ]
\scriptsize
\node {price}
    child[grow=right] {node (down) {FP}}
%    
    child[grow=south west]  {node (one) {P}}
    child[grow=south east]  {node (two) {F}}
    ;
\draw[red] (one) -- (down);
\end{tikzpicture};

相关内容