在Latex中绘制有向图

时间:2018-10-05 03:58:53

标签: graph latex

我想从A画一个箭头,指向图中的B,C,D..。我该如何在Latex中做到这一点。

到目前为止,我有:

\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}

enter image description here

1 个答案:

答案 0 :(得分:0)

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}