首页 > 解决方案 > 在 Latex 中绘制有向图

问题描述

我想画一个从 A 指向 B、C、D 的箭头,如图所示。我如何在乳胶中做到这一点。

到目前为止,我有:

\begin{tikzpicture}
\node[circle,draw](z){$A$}
  child{node[circle,draw]{B}} 
  child{node[circle,draw]{C}}
  child{node[circle,draw]{D}}
  child{node[circle,draw]{E}}
  child{node[circle,draw]{F}}
  child{node[circle,draw]{G}};
\end{tikzpicture}

在此处输入图像描述

标签: graphlatex

解决方案


nvm,我想通了。

\begin{tikzpicture}[edge from parent/.style={draw,-latex}]
\node[circle,draw](z){$A$}
  child{node[circle,draw]{B}} 
  child{node[circle,draw]{C}}
  child{node[circle,draw]{D}}
  child{node[circle,draw]{E}}
  child{node[circle,draw]{F}}
  child{node[circle,draw]{G}};
\end{tikzpicture}

推荐阅读