This question is building on the solution given here. I wanted to add a thick line to the enteries that are "0" so that the histogram would look like this:
Here is the code:
\documentclass[border=3mm,
tikz,
preview
]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
%---------------------------------------------------------------%
\begin{tikzpicture}
\begin{axis}[
ymin=0, ymax=10,
xmin=-0.5, xmax=8,
xtick={0, ..., 7},
ytick={0, ..., 9},
axis x line=bottom,
axis y line=left,
area style,
]
\addplot+[ybar interval] plot coordinates {
(-0.50, 0) (0.5, 9) (1.5, 7) (2.5, 0) (3.5, 2) (4.5, 6) (5.5, 0)
};
\path
\foreach[count=\i from 0] \v in {0, 9, 5, 0, 2, 6, 0} {
(\i, \v) node[below] {\v}
}
(axis description cs:1, 0) node[above left, align=center] {grey\\level}
;
\end{axis}
\end{tikzpicture}
\end{document}



ybar interval? – Alenanno Sep 13 '16 at 14:03(-0.50, 0.05) (0.5, 9) (1.5, 7) (2.5, 0.05) (3.5, 2) (4.5, 6) (5.5, 0.05) (7.5, 0.05)– Salim Bou Sep 13 '16 at 14:37