\begin{tikzpicture}[
scale=0.4,
declare function={unif(\k,\n)=1/\n;}
]
\begin{axis}[
axis lines = left,
xlabel = {$k$},
ylabel = {$P(X=k)$},
x label style={at={(axis description cs:1,0.1)},anchor=north},
y label style={at={(axis description cs:-0.15,1)},rotate = -90,
anchor=north},
yticklabel style={
/pgf/number format/fixed,
/pgf/number format/precision=2
},
ymin=0,
xmin=-0.5,
xmax=8.5,
samples at={2,...,7},
xtick={0,1,...,8},
ybar=0pt,
bar width=1,
bar shift=0pt,
]
\addplot[fill=rwth-50] {unif(x,5)};
\end{axis}
\end{tikzpicture}