The idea behind these visualizations comes from the paper graphing elementary Riemann surfaces by Robert M. Corless, & David J. Jeffrey.
An elementary Riemann surface is the Riemann surface associated to an elementary function. These elementary Riemann surfaces are non-compact they're obtained by analytic continuation of the elementary functions. Here we're going to plot $\sqrt{z}$, $\sqrt[3]{z}$, and $\mathrm{Log}(z)$.
The basig trick of Corless+Jeffrey is usign the inverse function to get the correct coordinates.
Let $f$ be an elementary function with inverse $g$. Let $w:= f(z)$, then $g(w)= z$. We can graph the surface letting $w := u + i v$ (where $i=\sqrt{-1}$), and graphing a chunk $[a,b]\times[c,d]$ of the $uv-$plane using the map $G:[a,b]\times[c,d]\rightarrow \mathbb{R}^3$ defined by, $$ w \mapsto (\Re(z),\Im(z), \Im(w))$$ And we can use $c := \Re(w) -\lfloor\Re(w)\rfloor)$ to color the surface to get a real 4D plot (where $\lfloor\bullet\rfloor$ is the floor function). We use only the decimal part of $u$ because the graphing software selects colors from the colormap using a number $c\in[0,1]$. This is a cosmetic improvement to Corless+Jeffrey because otherwise all the colored bits would be concentrated near the origin.
Note: for monomial powers it appears it doesn't matter if we take $\Re(w)$ as the $3^{\mathrm{rd}}$ component, and $\Im(w)$ as the color. But you get a very different surface for the Log function if you do that.
Here $f(z)= \sqrt{z}$, so $g(w)= w^2$.
cf = lambda u,v: v-floor(v)
cm = colormaps.hsv
G = (lambda u,v: ((u+i*v)^2).real(),lambda u,v: ((u+i*v)^2).imag(),lambda u,v: u)
P = parametric_plot3d(G,(-1,1),(-1,1),color=(cf,cm), plot_points = 200,aspect_ratio=1)
P = P.add_condition(lambda x,y,z: abs(x)<2)
P = P.add_condition(lambda x,y,z: abs(y)<2)
P = P.add_condition(lambda x,y,z: abs(z)<2)
P.show(frame=false, viewpoint = [[-0.4135,-0.3616,-0.8356],92.6])
Here $f(z) = \sqrt[3]{z}$, so $g(w)= w^3$.
cf = lambda u,v: v-floor(v)
cm = colormaps.hsv
G = (lambda u,v: ((u+i*v)^3).real(),lambda u,v: ((u+i*v)^3).imag(),lambda u,v: u)
P = parametric_plot3d(G,(-10,10),(-10,10),color=(cf,cm), plot_points = 200,aspect_ratio=1)
P = P.add_condition(lambda x,y,z: abs(x)<1.5)
P = P.add_condition(lambda x,y,z: abs(y)<2)
P = P.add_condition(lambda x,y,z: abs(z)<1)
P.show(frame=false, viewpoint=[[-0.5518,0.5515,0.6256],115.91])
Here $f(z) = \mathrm{Log}(z)$, and $g(w)= e^w$.
cf = lambda u,v: u-floor(u)
cm = colormaps.hsv
G = (lambda u,v: exp(u+i*v).real(),lambda u,v: exp(u+i*v).imag(),lambda u,v: v)
parametric_plot3d(G,(-2.7,2.7),(-(2.7)^(2.7),2.7^(2.7)),color=(cf,cm),
plot_points = 200, frame = false, viewpoint=[[-0.5956,-0.5169,-0.6149],109.36])
It appears only the real part encodes the infinite sheets of the Riemann surface for Log. See note above, and Corless+Jeffrey for a more indepth explanation.
cf = lambda u,v: v-floor(v)
cm = colormaps.hsv
G = (lambda u,v: exp(u+i*v).real(),lambda u,v: exp(u+i*v).imag(),lambda u,v: u)
parametric_plot3d(G,(-2.7,2.7),(-(2.7)^(2.7),2.7^(2.7)),color=(cf,cm)
,plot_points = 200, frame = false, viewpoint = [[-0.1143,-0.109,-0.9875],88.03])