How to Graph Floor/Ceiling Functions in LaTeX (PGFPlots)
You can use the jump mark mid
style for this, which draws horizontal unconnected line segments.
\begin{tikzpicture}
\begin{axis}[axis lines=middle]
\addplot [
jump mark mid,
domain=-3:3,
samples=100,
very thick, red
] {floor(3*x)+2};
\end{axis}
\end{tikzpicture}
to get
A fancier approach could be to use the discontinuous
style from the question Probability density function of Uniform Distribution to plot the intervals.