# Correct my Plot for $x \\lfoor x \\rfloor$

**URL:** <https://discourse.julialang.org/t/correct-my-plot-for-x-lfoor-x-rfloor/90981>\
**Category:** General Usage\
**Tags:** question\
**Created:** [November 29, 2022, 8:44am UTC](https://discourse.julialang.org/t/correct-my-plot-for-x-lfoor-x-rfloor/90981 "2022-11-29T08:44:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [November 29, 2022, 8:44am UTC](https://discourse.julialang.org/t/correct-my-plot-for-x-lfoor-x-rfloor/90981/1 "2022-11-29T08:44:19Z")

</div>

I do not know whether my plot is correct or not, I see the solution of definite integral is like this along with my plot.

 ![Capture d’écran_2022-11-29_15-43-29](https://global.discourse-cdn.com/julialang/original/3X/b/7/b72ffe3eed126f7985e5e18bec94e4bdd022470c.png)

This is my code:

```julia
using Plots,LaTeXStrings,Colors
gr()

f(x) = (x^2)*floor(x)
x = -4:1:4
y = f.(x)
plot(x[1:2], [y[1], y[1]], label=L"f(x) = x^{2} \lfloor x \rfloor", legend=:topleft,legend_foreground_color=:white, legend_font_color=:blue3, color=:blue3, showaxis=false, tickfontcolor=:white)
# axis and 
hline!((0,0), color=:black, label="")
vline!((0,0), color=:black, label="")
for i in x
	if i!= 0
		annotate!(i,-0.2, (i, 7))
	end
end
for i in y
	if i != 0
		annotate!(-.2, i, (i, 7))
	end
end
annotate!(-.2, -.2, ("0", 7))
for i in 2:length(x)-1
	plot!(x[i:i+1], [y[i], y[i]], label="", color=:blue3, lw=2)
	scatter!(x[i], y[i], marker=:circle, markersize=8, label="")
end
scatter!(x[1:end-1], y[1:end-1], markersize=3, markercolor=:blue4, label="")
scatter!(x[2:end], y[1:end-1], markersize=3, markercolor=:white, label="")

```

Is my plot correct, how you obtain such definite integral anyway?
