LaTeX 中的圆形图

LaTeX 中的圆形图

如何在 LaTeX 中绘制下图?但我不想在顶点处放黑点,而是想放数字。

在此处输入图片描述

答案1

欢迎!这是一个重复的问题,这里是一个重复的答案。箭头确实沿着一个圆圈。

\documentclass[border=3mm,tikz]{standalone}
\usetikzlibrary{arrows.meta,bending,calc,intersections}
\begin{document}
\begin{tikzpicture}[nodes={circle},
 pics/circular arc/.style args={from #1 to #2}{code={
 \path[name path=arc] 
  let \p1=(#1),\p2=(#2),\n1={Mod(720+atan2(\y1,\x1),360)},
  \n2={Mod(720+atan2(\y2,\x2),360)},
    \n3={ifthenelse(abs(\n1-\n2)<180,\n2,\n2+360)}
  in (\n1:\pgfkeysvalueof{/tikz/circular diagram/radius}) arc(\n1:\n3:\pgfkeysvalueof{/tikz/circular diagram/radius});
 \draw[pic actions,
    name intersections={of=#1 and arc,by=arcstart},
    name intersections={of=#2 and arc,by=arcend}] 
    let \p1=(arcstart),\p2=(arcend),\n1={Mod(720+atan2(\y1,\x1),360)},
     \n2={Mod(720+atan2(\y2,\x2),360)},
     \n3={ifthenelse(abs(\n1-\n2)<180,\n2,\n2+360)}
  in (\n1:\pgfkeysvalueof{/tikz/circular diagram/radius}) 
  arc(\n1:\n3:\pgfkeysvalueof{/tikz/circular diagram/radius}) 
  node[auto,midway,swap]{$\pgfkeysvalueof{/tikz/circular diagram/label}$};
 }},
pics/circular diagram/.style={code={
\foreach \XX/\ZZ [count=\YY starting from 1] in {#1}
{\xdef\mydim{\YY}};
\path foreach \XX/\ZZ [count=\YY starting from 0] in {#1}
{({\pgfkeysvalueof{/tikz/circular diagram/offset angle}+\YY*360/\mydim}:%
\pgfkeysvalueof{/tikz/circular diagram/radius}) node[name path=aux-\YY]
(aux-\YY) {$\XX$} };
\path[circular diagram/parc] foreach \XX/\ZZ 
[count=\YYY starting from 0,evaluate=\YYY as \YY using {int(mod(\YYY+1,\mydim))}]
in {#1}
{pic[circular diagram/label=\ZZ]{circular arc=from {aux-\YYY} to aux-\YY} 
};}},circular diagram/.cd,offset angle/.initial=0,radius/.initial=1,
parc/.style={thick,-{Stealth[bend]}},
arcs/.code={\tikzset{circular diagram/parc/.append style={#1}}},
label/.initial={}
]
\path 
 pic[rotate=90,circular diagram/.cd,radius=4,arcs={{Stealth[bend]}-}]{
    circular diagram={1/\alpha_n,n/\alpha_{n-1},n-1/\alpha_{n-2},%
    \rotatebox{-50}{$\dots$}/\alpha_i,i/\alpha_{i-1},\rotatebox{50}{$\dots$}/\alpha_3,3/\alpha_2,2/\alpha_1}}
    ;
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容