答案1
你可以这样做特别指定图表:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}[nodes={circle, draw}, >=Stealth]
\node (A) at (0,0) {};
\node (B) [below of=A] {};
\node (C) [below of=B] {};
\node (D) [left of=A] {};
\node (E) [right of=A] {};
\draw[->] (A) -- (B);
\draw[->] (B) -- (C);
\draw[->] (D) -- (B);
\draw[->] (E) -- (C);
\end{tikzpicture}
\end{document}
得出
对于较大的树,我建议在 CTAN 上寻找合适的包,例如forest
。
答案2
\documentclass[tikz,border=3mm]{standalone}
\begin{document}
\begin{tikzpicture}[nodes={circle,draw},my/.style={draw,latex-},
edge from parent/.style={my}]
\path node (b) {} [grow'=up]
child {node {}
child {node {}}
child {node {}}
child {node (r) {} edge from parent[draw=none]}
} (b) edge[my] (r)
(5,0) node (b') {} [grow'=up]
child {node {}
child {node (r') {} edge from parent[draw=none]}
child {node {}}
child {node {}}
} (b') edge[my] (r') ;
\end{tikzpicture}
\end{document}