My physics teacher gave a function $y = A\sin(\omega t \pm kx)$ and he gave it a phase shift of $\pi$ and said that the function would become $A\sin(kx \pm \omega t)$. I wanted to verify it myself so I plotted graphs on desmos. I had it in my mind that phase shift meant how much the graph will shift horizontally with respect to first graph. But upon graphing $y = \sin(x)$ and $y = -\sin(x)$, I realized that the 2nd graph has a shift of $2\pi$ with respect to the first one.
I am measuring this length shown in this image:
Am i missing something? is the above mentioned definition of phase shift wrong? (please educate me about the right one) am i measuring the wrong length? or whether my concepts are little loose.
Your help will be appreciated!! :)

Its because your $\sin$ curves are stretched. Check this resource for some nice pictures and term descriptions, but using the curves you have $$ y_1 = 2\sin\left(\frac{x}{2}+\frac{\pi}{2}\right) = 2\sin\left(\frac{1}{2}\left(x+\pi\right)\right) $$ so the phase shift here is $\pi$, not $\frac{\pi}{2}$ as we need to remove the stretch term first before we can see the shift. For your other curve $$ y_2 = 2\sin\left(\frac{x}{2}+\frac{3\pi}{2}\right) = 2\sin\left(\frac{1}{2}\left(x+3\pi\right)\right) $$ which is a phase shift of $3\pi$. As such the shift between the two is $$ 3\pi-\pi=2\pi $$ which is what you found on the graph