\begin{tikzpicture}[scale=1.5]
   \draw [triangle 45-triangle 45] (0,3) node (yaxis) [above] {$y$}|- (3,0) node (xaxis) [right] {$x$};
    \draw [color=red, thick, -triangle 45](0,0) -- +(2.5,2.5) node[midway,sloped,above] {Vektor $\vec a$};

    \draw [thick, -triangle 45](2.8,2.2) node[anchor=west] {''Pfeil''} -- (2.5,2.5) ;

    \foreach \y in {0,2,4}
        \draw (1pt,\y*0.5 cm) -- (-1pt,\y*0.5 cm) node[anchor=east] {$\y$};

    \foreach \x in {0,2,4}
        \draw (\x*0.5 cm,1pt) -- (\x*0.5 cm,-1pt) node[anchor=north] {$\x$};


    \draw [color=blue, dashed] (-0.1,2.5) -- (2.5,2.5);
    \draw [color=blue, dashed] (2.5,-0.1) -- (2.5,2.5);
        \node[blue] at (-0.25,2.5) {$a_2$};
        \node[blue] at (2.5,-0.25) {$a_1$};
\end{tikzpicture}
