如何在 tikz 中制作此图形?

如何在 tikz 中制作此图形?

有人能帮我用 TikZ 画这个吗?请注意,我在办公室里试图手绘了一些曲线 在此处输入图片描述

答案1

您在问下一个问题时能否提供一些 MWE?您会发现自己尝试这些东西(而不是依赖他人)会更有趣。

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{positioning,calc,arrows.meta}
\begin{document}
\begin{tikzpicture}[bullet/.style={draw,circle,minimum width=3mm,inner sep=0pt,
fill=cyan!50}]
 \node[bullet,label={[yshift=-2mm]below:$R_1$}] (R1){};
 \node[right=2cm of R1,bullet,label={[yshift=-2mm]below:$R_2$}] (R2){};
 \node[right=2cm of R2,yshift=6mm,bullet,label={[yshift=2mm]above:$R_3$}] (R3){};
 \node[right=2cm of R3,yshift=-6mm,bullet,label={[yshift=-2mm]below:$R_4$}] (R4){};
 \node[right=2cm of R4,bullet,label={[yshift=-2mm]below:$R_5$}] (R5){};
 \foreach \X [evaluate=\X as \Y using {int(\X+1)}] in {1,...,4}
 {\draw[thick,-latex,cyan!50] (R\X) -- (R\Y);}
 %
 \draw[thick,red,-latex] let \p1=($(R3)-(R2)$), \p2=($(R4)-(R3)$),
 \n1={atan2(\y1,\x1)},\n2={atan2(\y2,\x2)} in 
 ([yshift=-1mm]R2.south) to[out=\n1,in=180,looseness=0.5] ([yshift=-1mm]R3.south) 
 to[out=0,in=\n2-180,looseness=0.5] ([yshift=-1mm]R4.south);
 %
 \draw[thick,red,{Circle}-latex,dashed] let \p1=($(R2)-(R1)$), \p2=($(R3)-(R2)$),
 \n1={atan2(\y1,\x1)},\n2={atan2(\y2,\x2)} in 
 ([yshift=1mm]R1.north) to[out=\n1,in=180,looseness=0.5] ([yshift=1mm]R2.north) 
 to[out=0,in=\n2-180,looseness=0.5] ([yshift=1mm,xshift=-2mm]R3.north);
 %
 \draw[thick,{Circle}-latex,dashed] let \p1=($(R4)-(R3)$), \p2=($(R5)-(R4)$),
 \n1={atan2(\y1,\x1)},\n2={atan2(\y2,\x2)} in 
 ([yshift=1mm,xshift=2mm]R3.north) to[out=\n1,in=180,looseness=0.5] 
 ([yshift=1mm]R4.north) 
 to[out=0,in=\n2-180,looseness=0.5] ([yshift=1mm]R5.north);
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容