# Change unit of axis

I want to plot a trigonometry function (for example : $\lfloor 2\cos x\rfloor$) using Mathematica. And I want to scaling x axis using multiples of $\pi$ . For example $\frac{\pi}{2}$ , $\pi$ , $\frac{3\pi}{2}$ and $2\pi$. But in the graph doesn't show exact point of roots.

• stackoverflow.com/questions/8936579/…
– Alan
Dec 3, 2016 at 20:33
• @Alan Thank you , But it doesn't show exact values of roots in the graph versus $\pi$ multiples. Dec 3, 2016 at 20:47

sol = Sort@
DeleteDuplicates@
Cases[Table[
Reduce[Floor[2 Cos[x]] == i && 0 < x < 2 Pi, x], {i, -2, 2}],
_Times, Infinity]


ticks = Transpose@{sol, sol};

Plot[Floor[2 Cos[x]], {x, 0, 2 Pi}, Mesh -> {Range[-2, 2]},
MeshFunctions -> {#2 &}, MeshStyle -> Directive[Red, PointSize[.02]],
Ticks -> {ticks, Automatic}, Filling -> Axis]


• Fantastic ! Thank You. Dec 3, 2016 at 23:49
• Can you provide a good source for learning Mathematica ? Dec 3, 2016 at 23:52
• @S.H.W Practice and this site :) Dec 3, 2016 at 23:53
• In your picture , some of points must be empty. How I can determine this points ? Dec 3, 2016 at 23:55
• What is an empty point? Dec 4, 2016 at 10:02