% TeX root = ../main.tex

\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/fixed zerofill,
            /pgf/number format/precision=2
        },
        ymin=0,
        % ymax=0.3,
        xmin=-0.5,
        xmax=8.5,
        samples at={2,...,7},
        xtick={0,1,...,8},
        % xtick={0,1},
        % ytick={0,0.1,...,0.3},
        ybar=0pt,
        bar width=1,
        bar shift=0pt,
        % font=\tiny
    ]
        \addplot[fill=rwth-50] {unif(x,5)};
    \end{axis}
\end{tikzpicture}