For the labels on your y
-axis, you use
label.urt(btex $\pi$ etex,(xpart point 0 of C,u*(pi)));
label.urt(btex $1$ etex,(xpart point 0 of C,u*1));
label.urt(btex $2\pi$ etex,(xpart point 0 of C,u*(2pi)));
label.urt(btex $\frac{\pi}{2}$ etex,(xpart point 0 of C,u*(pi/2)));
label.urt(btex $-\frac{\pi}{2}$ etex,(xpart point 0 of C,u*(-pi/2)));
label.urt("$M$", point 1.3 of C);`
First, this has a lot of repetitions which makes it hard to adjust, so let's move this into a macro:
vardef labeled (expr t, y) =
save p; pair p;
p = (xpart point 0 of C, y*u);
label.urt(t, p);
enddef;
labeled(btex $\pi$ etex,pi);
labeled(btex $1$ etex,1);
labeled(btex $2\pi$ etex,2pi);
labeled(btex $\frac{\pi}{2}$ etex,pi/2);
labeled(btex $-\frac{\pi}{2}$ etex,-pi/2);
Now we can add little red lines to indicate the exact positions: Add
draw p shifted (-0.5mm, 0) -- p shifted (0.5mm, 0) withcolor red;
to labeled
. This gives

Now we see why -pi/2 seemed to be in a odd position and not symmetric to pi/2:
label.urt
places the label in an upper right position and therefore moves all labels a bit up. We can use label.rt
in labeled
instead to avoid this:

Now the axis still looks odd: The drawing seems to illustrate the correspondence between the length of the circular arc and the angle in radians, so it only works if the radius of the circle is 1 unit. So we change C = fullcircle scaled 5u;
to C = fullcircle scaled 2u;
(The diameter should be 2u
) This make the entire diagram quite small, so we could also increase u
. Our new figure is

Now we want to add alpha
. First we calculate alpha
by asking for the length of the arc (arclength
) of the path you are interested in (I use 1.2 instead of 1.3
because that is the path you actually used in your code):
alpha*u = arclength subpath(0,1.2) of C;
Then we can add
labeled(btex $\alpha$ etex, alpha);

It turns out that this arc has a length slightly below 1, so let's use subpath(0, 1.4)
instead to make it look a bit more like your original:

Now wwe can make everything a bit bigger and add some alignment to the labels to get:
\documentclass[border=5mm]{standalone}
\usepackage{luatex85}
\usepackage{luamplib}
\begin{document}
\mplibtextextlabel{enable}
\begin{mplibcode}
beginfig(1);
numeric u, pi;
u = 20mm;
pi = 3.141592654;
path C, T, xx, yy;
C = fullcircle scaled 2u;
xx = (point 4 of C -- point 0 of C) scaled 1.1;
yy = (point 6 of C -- point 2 of C) scaled 1.1;
T = ((xpart point 0 of C,6.5u) -- (xpart point 0 of C,-2u));
alpha*u = arclength subpath(0,1.4) of C;
draw xx;
draw yy;
draw C withpen pencircle scaled 3/4;
draw origin -- (point 1.4 of C) withcolor blue;
draw subpath(0,1.4) of C withcolor blue;
draw T withcolor red;
vardef labeled (expr t, y) =
save p; pair p;
p = (xpart point 0 of C, y*u);
label.rt(t, p);
draw p shifted (-0.5mm, 0) -- p shifted (0.5mm, 0) withcolor red;
enddef;
labeled(btex $\alpha$ etex,alpha);
labeled(btex \hbox to 1.5em{\hfill$\pi$} etex,pi);
labeled(btex \hbox to 1.5em{\hfill$1$} etex,1);
labeled(btex \hbox to 1.5em{\hfill$2\pi$} etex,2pi);
labeled(btex \hbox to 1.5em{\hfill$\frac{\pi}{2}$} etex,pi/2);
labeled(btex \hbox to 1.5em{\hfill$-\frac{\pi}{2}$} etex,-pi/2);
label.urt("$M$", point 1.4 of C);
label.llft("$O$", origin);
label.lrt("$I$", point 0 of C);
label.ulft("$J$", point 2 of C);
label.urt(btex $\frac{\pi}{2}$ etex, point 2 of C);
fill fullcircle scaled dotlabeldiam
shifted point 1.4 of C
withcolor blue;
endfig;
\end{mplibcode}
\end{document}
