[Tex/LaTex] Arrows on number line

arrows

How do I add arrows to both ends of this number line?

\begin{tikzpicture}
\begin{axis}[
  axis y line=none,
  axis lines=left,
  axis line style={-},
  xmin=112.5,
  xmax=121.5,
  ymin=0,
  ymax=1,
  xlabel=$\mu$,
  scatter/classes={o={mark=*}},
  restrict y to domain=0:1,
  xtick={113,114,...,121}
]
\end{axis}
\end{tikzpicture}

Best Answer

All you need to do is change the axis line style:

\documentclass{article}

\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}
\begin{axis}[
  axis y line=none,
  axis lines=left,
  axis line style={<->},
  xmin=112.5,
  xmax=121.5,
  ymin=0,
  ymax=1,
  xlabel=$\mu$,
  scatter/classes={o={mark=*}},
  restrict y to domain=0:1,
  xtick={113,114,...,121}
]
\end{axis}
\end{tikzpicture}

\end{document}

enter image description here

As @azetina notes, you can also use stealth, by doing axis line style={stealth-stealth},, which might be more aesthetically appealing:

enter image description here

Related Question