# Number Line with X tick intervals greater than 1

I'm creating a simple number line using the example Labeled Number Line. Where I'm getting stuck is that I want the x axis to start at 120 and go to 280 and only display intervals of 20 (120,140,160...260,280).

If I can do it without using pgfplots and just use TikZ that would be helpful (I'm only using BasicTex on Mac and get an error when I try to \usepackage{pgfplots}).

This is my code:

\documentclass{article}
\begin{tikzpicture}[scale=1.5]

\draw[thin] (0.5,0) -- (10.5,0);
\path [draw=black, fill=black] (1,0) circle (2pt);
\path [draw=black, fill=black] (10,0) circle (2pt);
\foreach \x  in {1,...,10}
\draw[xshift=\x cm] (0pt,2pt) -- (0pt,-2pt) node[below,fill=white] {120};
\draw[ultra thick] (1,0) -- (10,0);

\end{tikzpicture}
\end{document}

• Update your basictex to include pgfplots it is worth it. In general only install BasicTeX if really have no space left for a full installation. – daleif Oct 5 '16 at 9:07

You just need a small adjustment to your \foreach loop, and all 10 to 9, otherwise the numberline will have room to go to 300, instead of 280.

\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=1.5]

\draw[thin] (0.5,0) -- (9.5,0);