\documentclass{standalone}

\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{patterns}

\begin{document}
\begin{tikzpicture}[scale=0.7, every node/.style={scale=0.7}]

  % Draw the axis.
  \draw[->] (-1.0, 0) -- (5.2cm, 0) node[right] {$x$};
  \draw[->] (0, 0) -- (0, 5.2cm) node[above] {$y$};

  % Draw the needed points on the xx axis.
  \draw (0pt, 0pt) node[below] {$0$} -- (0pt, 1pt);
  \draw (0.8cm, 0pt) node[below] {$a$} -- (0.8cm, 1pt);
  \draw (3cm, 0pt) node[below] {$b$} -- (3cm, 1pt);

  % Mark the y_1, ..., y_4 points on the yy axis.
  \foreach \x in {1, ..., 4}
    \draw (0pt, \x) node[left] {$\x$} -- (1pt, \x);

  % Draw the constant function.
  \draw[color=cyan] (-0.75cm, 2cm) -- (5cm, 2cm) node[above] {$y=2$};

  % Draw the coloured area.
  \fill[pattern=north west lines, pattern color=red] (0.8cm, 0cm) rectangle (3cm, 2cm) ;

  % Draw the vertical lines that side-wise surround the coloured area.
  \draw[dashed] (0.8cm, 0pt) -- (0.8cm, 2cm);
  \draw[dashed] (3cm, 0pt) -- (3cm, 2cm);

\end{tikzpicture}
\end{document}