Because the first step goes from point (x[1], y[1]) to (x[2], y[1]). It’s the same for the rest of the steps inside the for loop.
I have cleaned my version a little bit (thanks to @rafael.guerra):
# Plot configuration
plot(legend_title=L"f(x) = \lfloor x \rfloor", legend=:bottomleft,legend_foreground_color=:white, legend_title_font_color=:blue, color=:blue, framestyle=:origin, ticks=x)
# Steps drawing
for i in 1:length(x)-1
plot!(x[i:i+1], [y[i], y[i]], label="", color=:blue, lw=2)
end
# Points at the beginning ot the steps
scatter!(x[1:end-1], y[1:end-1], markersize=3, markercolor=:blue, label="")
# End points
scatter!(x[2:end], y[1:end-1], markersize=3, markercolor=:white, label="")
# Adds '0' close to origin
annotate!(-.22, -.26, ("0", 8))
I’m sure it could be improved, but I think it’s quite close to the original.
