
I am trying to code the above picture.
This is my current code, but it does not look like the intended figure:
\begin{tikzpicture}
\draw[thick,->] (0,0) -- (8.5,0);
\draw[thick,->] (0,0) -- (0,4.5);
\draw[thick,-] (1,0) -- (1,1);
\draw[thick,-] (2,0) -- (2,1);
\draw[thick,-] (3,0) -- (3,1);
\draw[thick,-] (4,0) -- (4,1);
\draw[thick,-] (5,0) -- (5,1);
\draw[thick,-] (6,0) -- (6,1);
\draw[thick,-] (7,0) -- (7,1);
%\draw[thick,-] (4,0) -- (4,1);
\foreach \x in {0,1,2,3,4,5,6,7,8}
\draw (\x cm,1pt) -- (\x cm,-1pt) node[anchor=north] {$\x$};
\foreach \y in {0,1,2,3,4}
\draw (1pt,\y cm) -- (-1pt,\y cm) node[anchor=east] {$\y$};
\end{tikzpicture}
How can I change my code to obtain the desired output?

{}symbol. – eiterorm Sep 11 '14 at 11:29