答案1
看来使用纯 TikZ 是最简单的方法:
\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{positioning}
\tikzset{
node distance= 4mm and 2mm,
arr/.style = {thick, draw=#1},
arr/.default = red,
dot/.style = {circle, draw, very thin, fill, inner sep=0pt, outer sep=0pt,
minimum size=3pt,
label=right:$#1$,
node contents={}},
every label/.append style = {font=\scriptsize, inner sep=1pt}
}
\begin{document}
\begin{tikzpicture}
\node (a) [dot=a];
\node (b) [dot=b,above=of a];
\node (c) [dot=c,above=of b];
\draw[arr] (a) -- (b);
\draw[arr=green] (b) -- (c);
\end{tikzpicture}
\begin{tikzpicture}
\node (a) [dot=a];
\node (b) [dot=b,above right=of a];
\node (c) [dot=c,below right=of b];
\draw[arr] (a) -- (b);
\draw[arr=green] (b) -- (c);
\end{tikzpicture}
\end{document}