# How to write a Mathematica code to plot complex function in a 3D plane [closed]

f(x)=square(X)+ix. Plot a 3D plane for this complex function

• What is the relation of "a 3D plane" to this equation??? Jan 31 at 2:35
• What is a 3D plane? I've always thought that a plane can only be 2D. Jan 31 at 11:17

You could take the real part of $$f$$ as the $$x$$ coordinate, the imaginary part of $$f$$ as the $$y$$ coordinate, then use either the Abs of $$f$$ or its Argument for the $$z$$ coordinate and use ParametricPlot3D

f[z_] := Sqrt[z] + I*z;
ParametricPlot3D[{Re[f[x + I*y]], Im[f[x + I*y]],
Abs[f[x + I*y]]}, {x, -5, 5}, {y, -5, 5},
AxesLabel -> {"Real part", "imaginary part", "Magnitude"}] ParametricPlot3D[{Re[f[x + I*y]], Im[f[x + I*y]],
Arg[f[x + I*y]]}, {x, -5, 5}, {y, -5, 5},
AxesLabel -> {"Real part", "imaginary part", "Phase"},
PlotRange -> All] f[z_] := z^2 + I*z

ComplexPlot3D[f[z], {z, -5 - 5 I, 5 + 5 I},
AxesLabel -> {Re[z], Im[z], Abs[f[z]]},
Mesh -> Automatic,
PlotPoints -> 100,
MaxRecursion -> 4,
PlotLegends -> BarLegend[Automatic,
LegendLabel -> Arg[f[z]]]] ParametricPlot3D[
{Re[f[z]], Im[f[z]], z},
{z, -5, 5},
AxesLabel ->
{HoldForm@Re[f[z]], HoldForm@Im[f[z]], z}] 