答案1
绘制此图的一种可能方法是使用decorations.markings
沿曲线设置节点,例如,可以使用 绘制[bend left]
。\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}
是该库提供的计数器,我们可以在这里使用它。可以使用该fit
库绘制这些节点子集周围的圆圈。
\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{fit,decorations.markings}
\begin{document}
\begin{tikzpicture}[set marks/.style={postaction={decorate,decoration={markings,mark={between positions 0.2 and 0.8 step 0.2
with {\node[bullet,label=90:{$#1_{\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}}$}](#1\pgfkeysvalueof{/pgf/decoration/mark info/sequence
number}){};
}}}}},bullet/.style={circle,fill,inner sep=1.5pt},
cfit/.style={circle,draw,label=below right:#1}]
\draw[set marks=z] (0,0) node [bullet,label={[name=l0]below:{$z_0=w_0$}},alias=w0] (z0){}
to[bend left=20] (5,4) node [bullet,label={[name=l5]above:{$z_5=w_5$}},alias=w5] (z5){} ;
\draw[set marks=w] (0,0) to[bend right=20] (5,4);
\node[cfit=$D_0$,fit=(l0) (z1) (w1)]{};
\node[cfit=$D_1$,fit=(z2) (w2) (z1) (w1)]{};
\node[cfit=$D_2$,fit=(z2) (w2) (z3) (w3)]{};
\node[cfit=$D_3$,fit=(z4) (w4) (z3) (w3)]{};
\node[cfit=$D_4$,fit=(z4) (w4) (l5)]{};
\end{tikzpicture}
\end{document}
或者没有标记。
\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{fit}
\begin{document}
\begin{tikzpicture}[bullet/.style={circle,fill,inner sep=1.5pt},
cfit/.style={circle,draw,label=below right:#1}]
\draw (0,0) node [bullet,label={[name=l0]below:{$z_0=w_0$}},alias=w0] {}
to[bend left=20]
node[pos=0.2,bullet,label=120:$z_1$] (z1){}
node[pos=0.4,bullet,label=-20:$z_2$] (z2){}
node[pos=0.6,bullet,label=-20:$z_3$] (z3){}
node[pos=0.8,bullet,label=-90:$z_4$] (z4){}
(5,4) node [bullet,label={[name=l5]above:{$z_5=w_5$}},alias=w5] (z5){} ;
\draw (w0) to[bend right=20]
node[pos=0.2,bullet,label=90:$w_1$] (w1){}
node[pos=0.4,bullet,label=90:$w_2$] (w2){}
node[pos=0.6,bullet,label=90:$w_3$] (w3){}
node[pos=0.8,bullet,label=90:$w_4$] (w4){} (w5);
\node[cfit=$D_0$,fit=(l0) (z1) (w1)]{};
\node[cfit=$D_1$,fit=(z2) (w2) (z1) (w1)]{};
\node[cfit=$D_2$,fit=(z2) (w2) (z3) (w3)]{};
\node[cfit=$D_3$,fit=(z4) (w4) (z3) (w3)]{};
\node[cfit=$D_4$,fit=(z4) (w4) (l5)]{};
\end{tikzpicture}
\end{document}