한 가장자리에서 다른 가장자리로 곡선 화살표 그리기(tikz 그림)

한 가장자리에서 다른 가장자리로 곡선 화살표 그리기(tikz 그림)

다음 tex 코드를 작업 중입니다.

     \begin{tikzpicture}[x=7mm]
\draw[->] (0,0) -- (11,0);
\foreach \x in {0,...,10}
{
  \draw[shift={(\x,0)}] 
   (0pt,3pt) -- (0pt,-3pt) node[below,font=\small] {$\x$};
}
%\node[below] at (-5.8,-5pt) {$\cdots$};   
\node[below] at (11,-5pt) {$\cdots$};  
\end{tikzpicture}

이것은 나에게 다음과 같은 그림을 제공합니다 :

여기에 이미지 설명을 입력하세요

이 tikz 그림의 위쪽 부분에 각 노드 $i$에서 노드 $i+1$까지 곡선 화살표를 어떻게 그릴 수 있습니까? 각각 레이블은 "+1"입니다.

답변1

루프 내부에 다음 코드 줄을 추가하세요.

\draw[red,-latex] (\x,.2) arc(160:20:.5);

출력은 다음과 같습니다:

여기에 이미지 설명을 입력하세요

추가: 이 출력을 원하는 경우:

여기에 이미지 설명을 입력하세요

추가할 코드 줄은 다음과 같습니다.

\draw[red,-latex] (\x,.2) arc(160:20:.5) node[pos=.5,above] () {\small +1}; 

답변2

\documentclass{scrartcl}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[x=7mm]
  \draw[->] (0,0) -- (11,0);
  \foreach \x [count=\xi from 1] in {0,...,9}
    \draw[->,font=\tiny]
    (\x,0) to [bend left=90] node[above]{+1} (\xi,0);
\end{tikzpicture}
 \end{document}

여기에 이미지 설명을 입력하세요

답변3

또 다른 접근 방식.

\documentclass[tikz,border=5mm]{standalone}

\begin{document}

\begin{tikzpicture}[x=7mm]
  \draw[->] (0,0) -- (11,0);
  \foreach \x in {0,...,10}
  {
    \draw[shift={(\x,0)}] 
      (0pt,3pt) -- (0pt,-3pt) node[below,font=\small] {$\x$};
  }
  \node[below] at (11,-5pt) {$\cdots$};  
  
  % Draw curved arrows with labels
  \foreach \x in {0,...,9}
  {
    \draw[->, bend left=30, cyan] (\x,0.2) to node[below,font=\small, cyan] {$\scriptscriptstyle +1$} (\x+1,0.2);
  }
\end{tikzpicture}

\end{document}

여기에 이미지 설명을 입력하세요

관련 정보