森林树图 - 箭头不对齐

森林树图 - 箭头不对齐

我用这个答案创建了一棵类似的树:https://tex.stackexchange.com/a/256753/175628

但是箭头不对齐:与连接线: 在此处输入图片描述

这是森林代码:

\begin{figure}[H]
\begin{center}
\begin{forest}
  for tree={
    align=center,
    parent anchor=south,
    child anchor=north,
    font=\sffamily,
    edge={thick, -{Stealth[]}},
    l sep+=10pt,
    edge path={
      \noexpand\path [draw, \forestoption{edge}] (!u.parent anchor) -- +(0,-10pt) -| (.child anchor)\forestoption{edge label};
    },
    if level=0{
      inner xsep=0pt,
      tikz={\draw [thick] (.south east) -- (.south west);}
    }{}
  }
  [Graphical User Interface
    [\textbf{Drawing Functions}, name=A
      [\textbf{Plot Pane}
        [\textbf{Layer System}
          [\textbf{Draw onto Canvas}]
          [\textbf{Clear the Canvas}]
          [\textbf{Bind Properties}]
        ]
      ]
    ]
    [Shared Layer Access, name=C]
    [Inputing Functions, name=B
      [Add Functions]
      [Remove Functions]
      [Modify Functions]
    ]
  ]
\draw[-latex] (A) to[out=east,in=west] (C);
\draw[-latex] (B) to[out=west,in=east] (C);
\end{forest}
\end{center}
\caption{Graphical User Interface Hierarchical Diagram}

如果需要序言,我会发布它,但这是我弄混的最糟糕的东西。

答案1

欢迎来到 TeX.SE!您在寻找 吗calign=child,calign child=2

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage[edges]{forest}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{forest}
  for tree={
    align=center,
    calign=child,calign child=2,
    font=\sffamily,
    edge+={thick, -{Stealth[]}},
    l sep'+=10pt,
    fork sep'=10pt,
  },
  forked edges,
  if level=0{
    inner xsep=0pt,
    tikz={\draw [thick] (.children first) -- (.children last);}
  }{},
  [Graphical User Interface
    [\textbf{Drawing Functions}, name=A
      [\textbf{Plot Pane}
        [\textbf{Layer System}
          [\textbf{Draw onto Canvas}]
          [\textbf{Clear the Canvas}]
          [\textbf{Bind Properties}]
        ]
      ]
    ]
    [Shared Layer Access, name=C]
    [Inputing Functions, name=B
      [Add Functions]
      [Remove Functions]
      [Modify Functions]
    ]
  ]
\draw[-latex] (A) to[out=east,in=west] (C);
\draw[-latex] (B) to[out=west,in=east] (C);
\end{forest}
\end{document}

在此处输入图片描述

相关内容