答案1
您所需要的只是pgfplots
。符号坐标可以在这里提供帮助。由于pgfplots
基于 Ti钾Z,你可以添加各种Ti钾Z 的东西。快速:可能是,肮脏:你来决定,可改进:绝对可行。
\documentclass[tikz,border=3mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16,width=12cm, height=8cm}
\begin{document}
\begin{tikzpicture}[font=\sffamily,b1/.style={circle,minimum
size=1.7em,fill=blue,text=white},b2/.style={circle,minimum
size=1.5em,fill,text=white}]
\begin{axis}[axis lines=left,
xmin=8,xmax=26,xlabel=time,xtick={8,10,...,22},
ylabel=nodes,enlarge y limits=0.1,
symbolic y coords={n,k,j,i,1},
ytick=data,
]
\addplot[dashed,no marks] coordinates
{(8,1) (9,i) (10,i) (12,j) (15,j) (16,k) (19,k) (20,n)};
\addplot[mark=triangle*] coordinates {(8,i) (20,i)};
\addplot[mark=triangle*] coordinates {(14,j) (16,j)};
\addplot[mark=triangle*] coordinates {(15,k) (22,k)};
\path (9,1) coordinate (l) (24,1) coordinate (r);
\end{axis}
\path (l|-current axis.north) node[b1](1){1} --
(r|-current axis.north) node[b1](n){n}
foreach \X in {1,2,3} {coordinate[pos=\X/4,yshift={5pt+iseven(\X)*5pt}] (p\X)};
\draw[every label/.append style={align=center}] (1)
-- node[below]{$t_{1i}=1$} (p1) node[b2,label=above:{blabla\\blabla}](i){i}
-- node[below]{$t_{ij}=2$} (p2) node[b2,label=above:blabla](j){k}
-- node[below]{$t_{jk}=1$} (p3) node[b2,label=above:blabla](k){k}
-- node[below]{$t_{kn}=1$} (n);
\end{tikzpicture}
\end{document}