I'm working in the plotting the Riemann surface of two functions, namely:

$$ w_{1}(z)=\sqrt{1-z^{2}} \,, $$


$$ w_{2}(z)=\tanh\left(k\sqrt{1-z^{2}}\right)-2iz\frac{\sqrt{1-z^{2}}}{1-2z^{2}}\,, $$

where $k$ is a constant and $z$ is a complex number. All that I've tried until now didn't work. How to do this plot?


1 Answer 1


It would be more satisfying to make my own function to do this, but I could not improve upon the package in the second link that Lou provided.


Using the default options, you get something like this,

RiemannSurfacePlot3D[w == Sqrt[1 - z^2], Re[w], {z, w}]

enter image description here

You can tweak it to make some really pretty graphics. You can color the real surface by the value of the imaginary part, and show both in a grid. Thanks to Rahul for help with the color function, for other surfaces you may need to tweak the prefactor inside the ArcTan in order to see good color variation - the larger the prefactor, the more variation you see for small values. (I think having a nonlinear color bar would be helpful here)

rsurf[func_] := Grid[{{
    RiemannSurfacePlot3D[w == func, Re[w], {z, w},
     ImageSize -> 400, 
     Coloring -> Hue[Rescale[ArcTan[1.4 Im[w]], {-Pi/2, Pi/2}]],
     PlotPoints -> {40, 40}, Boxed -> False],
    RiemannSurfacePlot3D[w == func, Im[w], {z, w},
     ImageSize -> 400, 
     Coloring -> Hue[Rescale[ArcTan[1.4 Re[w]], {-Pi/2, Pi/2}]],
     PlotPoints -> {40, 40}, Boxed -> False]}}];
rsurf[Sqrt[1 - z^2]]

enter image description here

The more complicated the function, the longer it takes to plot, but they are more interesting,

With[{k = 1 + 2 I},
 rsurf[Tanh[k Sqrt[1 - z^2]] - 2 I z Sqrt[1 - z^2]/(1 - 2 z^2)]

enter image description here

  • 1
    $\begingroup$ Hello @JasonB, Thank you very much for your answer! I really appreciate that method! But could I insert the real and imaginary axes on the plot? $\endgroup$ Dec 2, 2015 at 14:35
  • 1
    $\begingroup$ @Jason B, Good approach, anyway, +1 $\endgroup$
    – user9660
    Dec 2, 2015 at 14:54
  • 4
    $\begingroup$ Shouldn't your Coloring be Hue[Rescale[ArcTan[.8 Im[w]], {-Pi/2, Pi/2}]]? $\endgroup$
    – user484
    Dec 3, 2015 at 0:07
  • 2
    $\begingroup$ @Rahul,you are right, since the ArcTan can return values from $\pm \pi/2$, I just arrived at the {-1,1} range from trial and error since arctan approaches those values only assymptotically, using the correct range will almost never use the full color range. There is some arbitrariness in the prefactor inside of the ArcTan function. I set it a little bit higher here and that gives a decent result. Thanks! $\endgroup$
    – Jason B.
    Dec 3, 2015 at 8:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.