# How to draw a number line with arrows inside it

I am having trouble using TiKz to draw a correct picture. Here is how I started it out:

\documentclass{amsart}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{arrows}

\begin{document}

\tikzset{->-/.style={decoration={
markings,
mark=at position #1 with {\arrow{<}}},postaction={decorate}}}

\begin{tikzpicture}
% a straight line segment
\draw[latex-] (-2,0) -- (0,0);
\draw[->-=.3] (0,0) -- (1,0);
\draw[->-=.6] (0,0) -- (1,0);
\draw[-latex] (1,0) -- (2,0);
% the ticks and their labels
\foreach \x  in {-1,...,1}
\draw[xshift=\x cm] (0pt,2pt) -- (0pt,-1pt) node[below,fill=white] {\the\numexpr\x +1\relax};
\end{tikzpicture}

\end{document}


But I want my picture to look like this:

How do I make the numbers appear correctly, and also make the curved arrows?

Like this?

\documentclass[tikz,border=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{arrows}

\begin{document}

\tikzset{->-/.style={decoration={
markings,
mark=at position #1 with {\arrow{>}}},postaction={decorate}}}

\begin{tikzpicture}
% a straight line segment
\draw[latex-] (-2,0) -- (0,0);
\draw[->-=.3] (0,0) -- (1,0);
\draw[->-=.6] (0,0) -- (1,0);
\draw[-latex] (1,0) -- (2,0);
% the ticks and their labels
\foreach \x [count=\i start from 0] in {-1,...,1}
\draw[xshift=\x cm] (0pt,2pt) -- (0pt,-1pt) node[below,fill=white] (\i) {\x};

\draw[->] (2) to [out=-95, in=-85] (0);
\draw[<-] (.25mm,1mm) arc(-85:265:3mm);
\end{tikzpicture}

\end{document}

• @ᴇʏᴇs I've updated the answer. You just need {\x} as node contents. \x cannot be used as node names because they are considered real values, and I've used \i which is an integer. But there is no problem using in nodes contents. – Ignasi May 15 '15 at 15:48