({{, (RefLink[ComplexPlot3D, paclet:ref/ComplexPlot3D])[f,{z,(Subscript[z, min]),(Subscript[z, max])}] 
generates a 3D plot of (RefLink[Abs, paclet:ref/Abs])[f] colored by (RefLink[Arg, paclet:ref/Arg])[f] over the complex rectangle with corners (Subscript[z, min]) and (Subscript[z, max]).}})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[ComplexPlot3D, paclet:ref/ComplexPlot3D]) plots (RefLink[Abs, paclet:ref/Abs])[f] with a cyclic color function over (RefLink[Arg, paclet:ref/Arg])[f] to identify features such as zeros, poles and essential singularities. The color function goes from -π to π counterclockwise around zeros, clockwise around poles and infinite cycles near essential singularities.

(RefLink[ComplexPlot3D, paclet:ref/ComplexPlot3D]) treats the variable z as local, effectively using (RefLink[Block, paclet:ref/Block]).

(RefLink[ComplexPlot3D, paclet:ref/ComplexPlot3D]) has attribute (RefLink[HoldAll, paclet:ref/HoldAll]) and evaluates f only after assigning specific numerical values to z.

(RefLink[ComplexPlot3D, paclet:ref/ComplexPlot3D]) has the same options as (RefLink[Graphics3D, paclet:ref/Graphics3D]) with following additions and changes:

(RefLink[ColorFunction, paclet:ref/ColorFunction])->{cfunc,sfunc} uses cfunc to generate the base color and sfunc to adjust the color to highlight features.

Possible named settings for sfunc are:

The arguments supplied to functions in (RefLink[MeshFunctions, paclet:ref/MeshFunctions]) and (RefLink[RegionFunction, paclet:ref/RegionFunction]) are z, f.  Functions in (RefLink[ColorFunction, paclet:ref/ColorFunction]) are by default supplied with scaled versions of (RefLink[Re, paclet:ref/Re])[z], (RefLink[Im, paclet:ref/Im])[z], (RefLink[Abs, paclet:ref/Abs])[z], (RefLink[Arg, paclet:ref/Arg])[z], (RefLink[Re, paclet:ref/Re])[f], (RefLink[Im, paclet:ref/Im])[f], (RefLink[Abs, paclet:ref/Abs])[f], (RefLink[Arg, paclet:ref/Arg])[f].

OpenersPrimaryExamplesSection(Spacer1)Examples  (112)

OpenersExampleSection0(Spacer1)Basic Examples  (3)

Plot a complex function with zeros at ±i and poles at ±1:

ComplexPlot3D[(((z^2)+1)/((z^2)-1)),{z,-2-2I,2+2I}]

Include a legend showing how the colors vary from -π to π:

ComplexPlot3D[(((z^2)+1)/((z^2)-1)),{z,-2-2I,2+2I},PlotLegends->Automatic]

Use color shading to highlight features of the function:

ComplexPlot3D[(((z^2)+1)/((z^2)-1)),{z,-2-2I,2+2I},ColorFunction->"CyclicLogAbsArg"]

OpenersExampleSection1(Spacer1)Scope  (21)

OpenersExampleSubsection0(Spacer1)Sampling  (7)

Sharp colors are generated by using a raster:

ComplexPlot3D[((((z+I))^3)/(((z+1))^2))Exp[(1/(z-1-I))],{z,-2-2I,2+2I}]

ComplexPlot3D[Exp[((5I)/z)],{z,-1-I,1+I}]

The default mesh shows curves of constant (RefLink[Abs, paclet:ref/Abs])[f] and (RefLink[Arg, paclet:ref/Arg])[f]:

ComplexPlot3D[(z^3)-(z^2)-2,{z,-2-2I,2+2I},Mesh->Automatic]

In the presence of poles, it is often convenient to use a logarithm to scale (RefLink[Abs, paclet:ref/Abs])[f]:

ComplexPlot3D[(((z+1+I))/(1-I+I z-(z^2))),{z,-2-2I,2+2I},Mesh->Automatic,ScalingFunctions->"Log"]

In the presence of poles, it may also be convenient to use a logarithm to scale the mesh for (RefLink[Abs, paclet:ref/Abs])[f]:

ComplexPlot3D[(((z+1+I))/(1-I+I z-(z^2))),{z,-2-2I,2+2I},Mesh->Automatic,MeshFunctions->{Log[Abs[#2]]&,Arg[#2]&}]

Specify values for the mesh and control the style:

ComplexPlot3D[(((z+1+I))/(1-I+I z-(z^2))),{z,-2-2I,2+2I},Mesh->{Range[-1,2,0.1],Range[-Pi,Pi,Pi/12]},MeshFunctions->{Log10[Abs[#2]]&,Arg[#2]&},MeshStyle->{Black,White}]

Modify the mesh to show specific values for (RefLink[Re, paclet:ref/Re])[f] and (RefLink[Im, paclet:ref/Im])[f]:

ComplexPlot3D[(((z^2)-I z - 1+I)/(z-I)),{z,-2-2I,2+2I},Mesh->{Range[-4,4,0.5],Range[-2,8,.5]},MeshFunctions->{Re[#2]&,Im[#2]&}]

Emphasize branch cuts with a color scheme that is discontinuous at the cut:

ComplexPlot3D[(((z^2)-I z - 1+I)/(z-I)),{z,-2-2I,2+2I},ColorFunction->"IslandColors",PlotLegends->Automatic]

OpenersExampleSubsection1(Spacer1)Presentation  (14)

Use a legend:

ComplexPlot3D[((Sin[2π z])/(z^3)),{z,-2-2I,2+2I},PlotLegends->Automatic]

Incorporate a mesh:

ComplexPlot3D[(((z^2)+1)/((z^2)-1)),{z,-2-2I,2+2I},Mesh->20,MeshFunctions->{Log[Abs[#2]]&,Arg[#2]&},MeshStyle->{White,Black}]

Turn off exclusions:

ComplexPlot3D[(((z^2)+1)/((z^2)-1)),{z,-2-2I,2+2I},ColorFunction->"Rainbow",Exclusions->None]

Use a scaling function:

ComplexPlot3D[(((z^2)+1)/((z^2)-1)),{z,-2-2I,2+2I},ScalingFunctions->"Log"]

Change the (RefLink[ColorFunction, paclet:ref/ColorFunction]):

ComplexPlot3D[(((z^3)-3)/z),{z,-2-2I,2+2I},ColorFunction->(Hue[#8+0.5]&)]

Use the "CyclicLogAbs" shading function to cyclically shade colors to give the appearance of contours of constant (RefLink[Abs, paclet:ref/Abs])[f]:

ComplexPlot3D[(((z^4)-1)/(z^2)),{z,-2-2I,2+2I},ColorFunction->"CyclicLogAbs",PlotLegends->Automatic]

Use the "CyclicArg" shading function to cyclically shade colors to give the appearance of contours of constant (RefLink[Arg, paclet:ref/Arg])[f]:

ComplexPlot3D[(((z^4)-1)/(z^2)),{z,-2-2I,2+2I},ColorFunction->"CyclicArg",PlotLegends->Automatic]

Use the "CyclicLogAbsArg" shading function to cyclically shade colors to give the appearance of contours of constant (RefLink[Abs, paclet:ref/Abs])[f] and constant (RefLink[Arg, paclet:ref/Arg])[f]:

ComplexPlot3D[(((z^4)-1)/(z^2)),{z,-2-2I,2+2I},ColorFunction->"CyclicLogAbsArg"]

Use the "GlobalAbs" shading function to highlight zeros (black) and poles (white):

ComplexPlot3D[(((z^4)-1)/(z^2)),{z,-2-2I,2+2I},ColorFunction->"GlobalAbs",PlotLegends->Automatic]

Use "QuantileAbs" to darken small values of (RefLink[Abs, paclet:ref/Abs])[f] and lighten large values of (RefLink[Abs, paclet:ref/Abs])[f]:

ComplexPlot3D[(((z^4)-1)/(z^2)),{z,-2-2I,2+2I},ColorFunction->"QuantileAbs"]

Use "MaxAbs" to lighten large values of (RefLink[Abs, paclet:ref/Abs])[f]:

ComplexPlot3D[(((z^4)-1)/(z^2)),{z,-2-2I,2+2I},ColorFunction->"MaxAbs"]

Use "LocalMaxAbs" to lighten relatively large values of (RefLink[Abs, paclet:ref/Abs])[f]:

ComplexPlot3D[(((z^4)-1)/(z^2)),{z,-2-2I,2+2I},ColorFunction->"LocalMaxAbs"]

Use "CyclicReImLogAbs" to cyclically darken based on (RefLink[Re, paclet:ref/Re])[f] and (RefLink[Im, paclet:ref/Im])[f] and lighten cyclically based on (RefLink[Log, paclet:ref/Log])[(RefLink[Abs, paclet:ref/Abs])[f]]:

ComplexPlot3D[(((z^3)-1)/z),{z,-2-2I,2+2I},ColorFunction->"CyclicReImLogAbs"]

Use "ShiftedCyclicLogAbs" to produce clear color wheels around zeros and cyclic contours based on (RefLink[Log, paclet:ref/Log])[(RefLink[Abs, paclet:ref/Abs])[f]]:

ComplexPlot3D[(((z^4)-1)/(z^2)),{z,-2-2I,2+2I},ColorFunction->"ShiftedCyclicLogAbs"]

OpenersExampleSection2(Spacer1)Options  (62)

OpenersExampleSubsection2(Spacer1)BoundaryStyle  (3)

Use a black boundary around the edges of the surface:

ComplexPlot3D[((z+I)/(z-I)),{z,-2-2I,2+2I}]

Use a thick, black boundary around the edges of the surface:

ComplexPlot3D[((z+I)/(z-I)),{z,-2-2I,2+2I},BoundaryStyle->Directive[Black,Thick]]

Note that (RefLink[BoundaryStyle, paclet:ref/BoundaryStyle]) applies to holes cut by (RefLink[RegionFunction, paclet:ref/RegionFunction]), but not to holes cut by (RefLink[Exclusions, paclet:ref/Exclusions]):

ComplexPlot3D[((z+I)/(z-I)),{z,-2-2I,2+2I},BoundaryStyle->Directive[Black,Thick],RegionFunction->Function[{z,w},Abs[z]≥1/2]]

OpenersExampleSubsection3(Spacer1)BoxRatios  (2)

(RefLink[Automatic, paclet:ref/Automatic]) uses the natural scale from (RefLink[PlotRange, paclet:ref/PlotRange]):

{ComplexPlot3D[Sin[z],{z,-2Pi-2I,2Pi+2I}],ComplexPlot3D[Sin[z],{z,-2Pi-2I,2Pi+2I},BoxRatios->Automatic]}

Use (RefLink[BoxRatios, paclet:ref/BoxRatios]) to specify the relative dimensions of the bounding box for the plot:

ComplexPlot3D[(((z^2)+1)/((z^2)-1)),{z,-2-1I,2+I},BoxRatios->{2,1,2}]

OpenersExampleSubsection4(Spacer1)ClippingStyle  (2)

Clipped regions use different surface colors by default:

ComplexPlot3D[((z+I)/(z-I)),{z,-2-2I,2+2I}]

Do not draw clipped regions:

ComplexPlot3D[((z+I)/(z-I)),{z,-2-2I,2+2I},ClippingStyle->None]

OpenersExampleSubsection5(Spacer1)ColorFunction  (14)

Use a noncyclic color function to emphasize branch cuts:

ComplexPlot3D[(((z^5)-3)/(z^3)),{z,-2-2I,2+2I},ColorFunction->"GreenPinkTones",PlotLegends->Automatic]

(RefLink[LogGamma, paclet:ref/LogGamma]) and (RefLink[Log, paclet:ref/Log])[(RefLink[Gamma, paclet:ref/Gamma])] have different branch cuts:

{
ComplexPlot3D[LogGamma[z] ,{z,-3-3I,3+3I},ColorFunction->ColorData["CMYKColors"]],
ComplexPlot3D[Log[Gamma[z]] ,{z,-3-3I,3+3I},ColorFunction->ColorData["CMYKColors"]]
}

Specify a custom (RefLink[ColorFunction, paclet:ref/ColorFunction]):

ComplexPlot3D[(z^3)+3z+8+(1/(((z-2))^2)),{z,-3-3I,3+3I},ColorFunction->(Hue[#8+0.5]&)]

clrs=GrayLevel/@Join[Range[0,1,.25],Range[.75,0,-.25]]

ComplexPlot3D[(z^3)+3z+8+(1/(((z-2))^2)),{z,-3-3I,3+3I},ColorFunction->(Blend[clrs,#8]&)]

Color functions depend on eight arguments ((RefLink[Re, paclet:ref/Re])[z], (RefLink[Im, paclet:ref/Im])[z], (RefLink[Abs, paclet:ref/Abs])[z], (RefLink[Arg, paclet:ref/Arg])[z], (RefLink[Re, paclet:ref/Re])[f], (RefLink[Im, paclet:ref/Im])[f], (RefLink[Abs, paclet:ref/Abs])[f], (RefLink[Arg, paclet:ref/Arg])[f]):

ComplexPlot3D[(((z^2)+1)/((z^2)-1)),{z,-2-2I,2+2I},ColorFunction->{Hue[((#8)/(2π)),(0.9^(#7)),If[#3<1.5,1,0.75]]&,None},ColorFunctionScaling->False,Exclusions->None]

ComplexPlot3D[(((z^2)+1)/((z^2)-1)),{z,-2-2I,2+2I},ColorFunction->(Hue[#8,1-((Cos[8π#8])^20),1-0.2SawtoothWave[6#7]]&),ColorFunctionScaling->False]

ComplexPlot3D[(z^3)-2,{z,-2-2I,2+2I},ColorFunction->(Hue[#7,1-0.2SawtoothWave[8 #5],1-0.2SawtoothWave[8#6]]&)]

Color functions can be shaded to highlight features of a graph like zeros, poles and saddle points. Use "CyclicLogAbs" to cyclically shade colors to give the appearance of contours of constant (RefLink[Abs, paclet:ref/Abs])[f] at powers of 2:

ComplexPlot3D[(((z^2)+1)/((z^2)-1)),{z,-2-2I,2+2I},ColorFunction->"CyclicLogAbs"]

Use "CyclicArg" to cyclically shade colors to give the appearance of contours of constant (RefLink[Arg, paclet:ref/Arg])[f] at integer multiples of π/6:

ComplexPlot3D[(((z^2)+1)/((z^2)-1)),{z,-2-2I,2+2I},ColorFunction->"CyclicArg"]

Use "CylicLogAbsArg" shading function to combine the effects of "CyclicLogAbs" and "CyclicArg":

ComplexPlot3D[(((z^2)+1)/((z^2)-1)),{z,-2-2I,2+2I},ColorFunction->"CyclicLogAbsArg"]

Shading can be applied to any (RefLink[ColorFunction, paclet:ref/ColorFunction]):

ComplexPlot3D[(((z^2)+1)/((z^2)-1)),{z,-2-2I,2+2I},ColorFunction->{"WatermelonColors","CyclicLogAbsArg"}]

Use "GlobalAbs" to highlight zeros (black) and poles (white):

ComplexPlot3D[(((z^2)+1)/((z^2)-1)),{z,-2-2I,2+2I},ColorFunction->"GlobalAbs"]

Use "QuantileAbs" to lighten the image at relatively large values of (RefLink[Abs, paclet:ref/Abs])[f]:

ComplexPlot3D[(((z^2)+1)/((z^2)-1)),{z,-2-2I,2+2I},ColorFunction->"QuantileAbs"]

Use "MaxAbs" to lighten the image at large values of (RefLink[Abs, paclet:ref/Abs])[f]:

ComplexPlot3D[(((z^2)+1)/((z^2)-1)),{z,-2-2I,2+2I},ColorFunction->"MaxAbs"]

Use "LocalMaxAbs" to lighten the image at relatively large values of (RefLink[Abs, paclet:ref/Abs])[f]:

ComplexPlot3D[(((z^2)+1)/((z^2)-1)),{z,-2-2I,2+2I},ColorFunction->"LocalMaxAbs"]

Use "ShiftedCyclicLogAbs" to produce a color wheel around each zero and cyclic shading in (RefLink[Log, paclet:ref/Log])[(RefLink[Abs, paclet:ref/Abs])[f]]:

ComplexPlot3D[(((z^4)-1)/(z^2)),{z,-2-2I,2+2I},ColorFunction->"ShiftedCyclicLogAbs"]

Use "CyclicReImLogAbs" to darken the plot cyclically in (RefLink[Re, paclet:ref/Re])[f] and (RefLink[Im, paclet:ref/Im])[f] and brighten it cyclically in (RefLink[Log, paclet:ref/Log])[(RefLink[Abs, paclet:ref/Abs])[f]]:

ComplexPlot3D[(z^2)+1,{z,-2-2I,2+2I},ColorFunction->"CyclicReImLogAbs"]

OpenersExampleSubsection6(Spacer1)ColorFunctionScaling  (1)

(RefLink[Re, paclet:ref/Re])[z], (RefLink[Im, paclet:ref/Im])[z], (RefLink[Abs, paclet:ref/Abs])[z], (RefLink[Arg, paclet:ref/Arg])[z], (RefLink[Re, paclet:ref/Re])[f], (RefLink[Im, paclet:ref/Im])[f], (RefLink[Abs, paclet:ref/Abs])[f] and (RefLink[Arg, paclet:ref/Arg])[f] are scaled by default. Use (RefLink[ColorFunctionScaling, paclet:ref/ColorFunctionScaling]) to change it:

ComplexPlot3D[(((z^2)+1)/((z^2)-1)),{z,-2-2I,2+2I},ColorFunctionScaling->False,PlotLegends->Automatic]

OpenersExampleSubsection7(Spacer1)Exclusions  (4)

Automatically determine exclusions in the modulus of the function:

ComplexPlot3D[z+Conjugate[z] Floor[Abs[z]],{z,-3-3I,3+3I}]

For cyclic color functions, only exclusions based on (RefLink[Abs, paclet:ref/Abs])[f] are shown. but for acyclic color functions, exclusions based on (RefLink[Arg, paclet:ref/Arg])[f] are also displayed:

ComplexPlot3D[(z^4)-1,{z,-2-2I,2+2I},ColorFunction->"Rainbow",PlotLegends->Automatic]

Specify exclusions using equations:

ComplexPlot3D[(z^2),{z,-3-3I,3+3I},Exclusions->{Re[z]==0}]

ComplexPlot3D[((((z+2I))^2)/(((z+2))^2)),{z,-3-3I,3+3I},Exclusions->{(((Re[z]+1))^2)+(((Im[z]+1))^2)==2}]

Use no exclusions:

ComplexPlot3D[z+Conjugate[z] Floor[Abs[z]],{z,-3-3I,3+3I},Exclusions->None]

OpenersExampleSubsection8(Spacer1)ExclusionStyle  (1)

Style exclusions with a thick, dashed, black line and the surface in between transparent:

ComplexPlot3D[z+Conjugate[z] Floor[Abs[z]],{z,-3-3I,3+3I},ExclusionsStyle->{Opacity[0.5],Directive[Dashed,Black,Thick]}]

OpenersExampleSubsection9(Spacer1)Filling  (2)

Fill to the bottom:

ComplexPlot3D[(((z^2)+1)/((z^2)-1)),{z,-2-2I,2+2I},Filling->Bottom]

Filling occurs along the region cut by (RefLink[RegionFunction, paclet:ref/RegionFunction]):

ComplexPlot3D[(((z^2)+1)/((z^2)-1)),{z,-2-2I,2+2I},Filling->Bottom,RegionFunction->(Abs[#1]≤2&)]

OpenersExampleSubsection10(Spacer1)FillingStyle  (3)

Fill to the bottom with a specified style:

ComplexPlot3D[(((z^2)+1)/((z^2)-1)),{z,-2-2I,2+2I},Filling->Bottom,FillingStyle->Directive[Opacity[0.5],Black]]

Fill to the plane (RefLink[Abs, paclet:ref/Abs])[f]=1 with red below and blue above:

ComplexPlot3D[(((z^2)+1)/((z^2)-1)),{z,-2-2I,2+2I},Filling->1,FillingStyle->{Red,Blue}]

Fill to the plane (RefLink[Abs, paclet:ref/Abs])[f]=1 from below only:

ComplexPlot3D[(((z^2)+1)/((z^2)-1)),{z,-2-2I,2+2I},Filling->1,FillingStyle->{Red,None}]

OpenersExampleSubsection11(Spacer1)MaxRecursion  (2)

If a region function is used, (RefLink[MaxRecursion, paclet:ref/MaxRecursion]) adapts the initial mesh:

Table[ComplexPlot3D[z/((z^2)+1),{z,-2-2I,2+2I},PlotPoints->5,MaxRecursion->mr,RegionFunction->Function[{z},Abs[z]≤2],PlotLabel->mr],{mr,0,2}]

If a mesh is used, (RefLink[MaxRecursion, paclet:ref/MaxRecursion]) adapts the initial mesh:

Table[ComplexPlot3D[z/((z^2)+1),{z,-2-2I,2+2I},PlotPoints->8,MaxRecursion->mr,Mesh->10,PlotLabel->mr],{mr,0,2}]

OpenersExampleSubsection12(Spacer1)Mesh  (2)

Specify a uniform mesh for (RefLink[Abs, paclet:ref/Abs]) and (RefLink[Arg, paclet:ref/Arg]):

ComplexPlot3D[(z^2)+I,{z,-3-3I,3+3I},Mesh->10]

Specify values for the mesh:

ComplexPlot3D[(z^2)+I,{z,-3-3I,3+3I},Mesh->{Range[0,18,2],Range[-Pi,Pi,Pi/12]}]

OpenersExampleSubsection13(Spacer1)MeshFunctions  (2)

Change the (RefLink[MeshFunctions, paclet:ref/MeshFunctions]) from {(RefLink[Abs, paclet:ref/Abs])[f],(RefLink[Arg, paclet:ref/Arg])[f]} to {(RefLink[Re, paclet:ref/Re])[f],(RefLink[Im, paclet:ref/Im])[f]}:

ComplexPlot3D[(z^2)+I,{z,-3-3I,3+3I},Mesh->Automatic,MeshFunctions->{Re[#2]&,Im[#2]&}]

{(RefLink[Log, paclet:ref/Log])[(RefLink[Abs, paclet:ref/Abs])[f]],(RefLink[Arg, paclet:ref/Arg])[f]} often works well with poles:

ComplexPlot3D[((((z^2)+I)((z^2)+2+2I))/(((z+2+I))^2)),{z,-3-3I,3+3I},Mesh->10,MeshFunctions->{Log[Abs[#2]]&,Arg[#2]&},PlotRange->{0,500}]

OpenersExampleSubsection14(Spacer1)MeshShading  (2)

Alternate color with black and white:

ComplexPlot3D[(z^2)+1,{z,-2-2I,2+2I},Mesh->20,MeshShading->{{Automatic, Black},{Automatic,White}}]

Shade the mesh to highlight (RefLink[Abs, paclet:ref/Abs])[f]:

ComplexPlot3D[((z-1)/((z^2)+z+1)),{z,-2-2I,2+2I},Mesh->20,MeshShading->{Black,White},MeshFunctions->{Log[Abs[#2]]&}]

OpenersExampleSubsection15(Spacer1)MeshStyle  (2)

Use a white mesh in the (RefLink[Abs, paclet:ref/Abs])[f] direction and a black mesh in the (RefLink[Arg, paclet:ref/Arg])[f] direction:

ComplexPlot3D[(z^2)+1,{z,-2-2I,2+2I},Mesh->Automatic,MeshStyle->{White,Black}]

Use a red mesh in the (RefLink[Abs, paclet:ref/Abs])[f] direction and a blue mesh in the (RefLink[Arg, paclet:ref/Arg])[f] direction:

ComplexPlot3D[(z^2)+1,{z,-2-2I,2+2I},Mesh->Automatic,MeshShading->{{Gray,White},{White, Gray}},MeshStyle->{Red,Blue}]

OpenersExampleSubsection16(Spacer1)NormalsFunction  (2)

Normals are automatically calculated. Use (RefLink[None, paclet:ref/None]) to get flat shading for all of the polygons:

ComplexPlot3D[1/((z^2)+1-I),{z,-2-2I,2+2I},NormalsFunction->None]

Make the effective normals to the surface vary locally:

ComplexPlot3D[1/((z^2)+1-I),{z,-2-2I,2+2I},NormalsFunction->({Sin[2Pi#1],Cos[2Pi#2],1}&)]

OpenersExampleSubsection17(Spacer1)PlotLegends  (2)

The (RefLink[Automatic, paclet:ref/Automatic]) legend shows the association between color and phase. The grayscale part of the legend indicates how the colors are shaded:

ComplexPlot3D[Sin[z],{z,-π-2I,π+2I},PlotLegends->Automatic]

Cyclic shading is also reflected in the legend:

ComplexPlot3D[Sin[z],{z,-π-2I,π+2I},ColorFunction->"CyclicLogAbs",PlotLegends->Automatic]

OpenersExampleSubsection18(Spacer1)PlotPoints  (2)

Use more points to smooth out a nonrectangular boundary or an exclusion:

Table[ComplexPlot3D[((Sin[3z])/(z^3)),{z,-2-2I,2+2I},RegionFunction->Function[{z},Im[(z^2)]≤1],PlotPoints->i],{i,{5,20}}]

Use more points to smooth out a mesh:

Table[ComplexPlot3D[((Sin[3z])/(z^3)),{z,-2-2I,2+2I},Mesh->Automatic,PlotPoints->i],{i,{5,20}}]

OpenersExampleSubsection19(Spacer1)PlotRange  (3)

Automatically compute the range for (RefLink[Abs, paclet:ref/Abs])[f]:

ComplexPlot3D[((Sin[3z])/(z^2)),{z,-1-I,1+I}]

Specify the range for (RefLink[Abs, paclet:ref/Abs])[f]:

ComplexPlot3D[((Sin[3z])/(z^2)),{z,-1-I,1+I},PlotRange->{0,50}]

Specify the dimensions of the domain of f and range of (RefLink[Abs, paclet:ref/Abs])[f]:

ComplexPlot3D[((Sin[3z])/(z^2)),{z,-1-I,1+I},PlotRange->{{-2,2},{-2,2},{0,50}}]

OpenersExampleSubsection20(Spacer1)PlotStyle  (1)

(RefLink[PlotStyle, paclet:ref/PlotStyle]) can be used to modify the colors:

ComplexPlot3D[((Sin[3z])/(z^3)),{z,-2-2I,2+2I},PlotStyle->Opacity[0.5]]

OpenersExampleSubsection21(Spacer1)PlotTheme  (1)

Modify the appearance with a theme:

ComplexPlot3D[((Sin[3z])/(z^3)),{z,-2-2I,2+2I},PlotTheme->"Marketing"]

OpenersExampleSubsection22(Spacer1)RegionFunction  (3)

Use (RefLink[RegionFunction, paclet:ref/RegionFunction]) to adapt the shape of the region:

ComplexPlot3D[(((z^2)+1)/((z^2)-1)),{z,-2-2I,2+2I},RegionFunction->Function[{z},Abs[z]≤2]]

Use (RefLink[RegionFunction, paclet:ref/RegionFunction]) to remove zeros and poles:

ComplexPlot3D[(((z^2)+1)/((z^2)-1)),{z,-2-2I,2+2I},RegionFunction->Function[{z,f},1≤Abs[f]≤2]]

Shape the region based on (RefLink[Arg, paclet:ref/Arg])[z] or (RefLink[Arg, paclet:ref/Arg])[f]:

{ComplexPlot3D[(((z^2)+1)/((z^2)-1)),{z,-2-2I,2+2I},RegionFunction->Function[{z,f},-π/2≤Arg[z]<π]],ComplexPlot3D[(((z^2)+1)/((z^2)-1)),{z,-2-2I,2+2I},RegionFunction->Function[{z,f},-π/2≤Arg[f]<π]]}

OpenersExampleSubsection23(Spacer1)ScalingFunctions  (4)

Use a log scale in the direction of (RefLink[Abs, paclet:ref/Abs])[f]:

ComplexPlot3D[(z/((z^2)-1)),{z,-2-2I,2+2I},ScalingFunctions->"Log"]

Effectively swap zeros and poles by using a reciprocal scale in the direction of (RefLink[Abs, paclet:ref/Abs])[f]:

ComplexPlot3D[(z/((z^2)-1)),{z,-2-2I,2+2I},ScalingFunctions->"Reciprocal"]

Use a combination of scaling functions. Reverse (RefLink[Re, paclet:ref/Re])[f], leave (RefLink[Im, paclet:ref/Im])[f] intact and reciprocate (RefLink[Abs, paclet:ref/Abs])[f]:

ComplexPlot3D[(z/((z^2)-1)),{z,-2-2I,2+2I},ScalingFunctions->{"Reverse",None,"Reciprocal"}]

Use logarithmic scaling in all three directions:

ComplexPlot3D[Exp[z]/(z-5-5I)^3,{z,1+I,10+10I},ScalingFunctions->{"Log10","Log10","Log10"}]

OpenersExampleSubsection24(Spacer1)WorkingPrecision  (2)

Evaluate functions using machine-precision arithmetic:

ComplexPlot3D[Exp[I Sin[z]],{z,-2Pi-2Pi I,2Pi+2Pi I},WorkingPrecision->MachinePrecision]

Evaluate functions using arbitrary-precision arithmetic:

ComplexPlot3D[Exp[(5/(z^4))],{z,-2-2 I,2+2 I},WorkingPrecision->5]

OpenersExampleSection3(Spacer1)Applications  (26)

OpenersExampleSubsection25(Spacer1)Basic Applications  (10)

For a complex function f:ℂ->ℂ, plot (RefLink[Abs, paclet:ref/Abs])[f] over the complex plane. Points on the surface are colored (by default) by (RefLink[Arg, paclet:ref/Arg])[f], and that information is recorded in an optional legend.

When viewed from above, the color function proceeds counterclockwise around zeros of a function:

ComplexPlot3D[z,{z,-2-2I,2+2I},PlotLegends->Automatic]

At a multiple zero, the colors cycle around the zero multiple times:

ComplexPlot3D[(z^3),{z,-2-2I,2+2I},PlotLegends->Automatic]

At a pole, the colors cycle around the point in the reverse direction:

ComplexPlot3D[1/z,{z,-2-2I,2+2I},PlotLegends->Automatic]

At an essential singularity, the colors cycle infinitely often:

ComplexPlot3D[Exp[I/z],{z,-0.5-0.5I,0.5+0.5I}]

Use (RefLink[PlotRange, paclet:ref/PlotRange]) to control the height of the graph near a pole:

ComplexPlot3D[Exp[I/z],{z,-0.5-0.5I,0.5+0.5I},PlotRange->{0,(10^6)}]

Using a logarithmic scaling function for functions with poles may produce a more visually appealing plot:

ComplexPlot3D[Exp[I/z],{z,-0.5-0.5I,0.5+0.5I},ScalingFunctions->"Log"]

Using (RefLink[ScalingFunctions, paclet:ref/ScalingFunctions])->"Reciprocal" effectively swaps zeros and poles in terms of height, but the colors remain unchanged:

{ComplexPlot3D[((((z-1))^2)/(z+1)),{z,-2-2I,2+2I},ScalingFunctions->None],
ComplexPlot3D[((((z-1))^2)/(z+1)),{z,-2-2I,2+2I},ScalingFunctions->"Reciprocal"]}

At a saddle point (Subscript[z, 0]) of f, f'((Subscript[z, 0]))=0 and f((Subscript[z, 0]))≠0. Use "CyclicLogAbs" to highlight a saddle point that occurs at a power of 2:

ComplexPlot3D[(z^3)+1,{z,-2-2I,2+2I},ColorFunction->"CyclicLogAbs"]

Or use a mesh to highlight a saddle point:

ComplexPlot3D[(z^3)+1,{z,-2-2I,2+2I},Mesh->{Range[0,5],Range[-Pi,Pi,Pi/4]},MeshFunctions->{Log[Abs[#2]]&,Arg[#2]&},PlotPoints->75]

The following plot shows multiple features of the Joukowski transformation. There are simple zeros at z=±i, which is evident from the height of the graph and the fact that the colors converge at those points and cycle around the points from blue to green to red in the counterclockwise direction, consistent with the legend. Similarly, there is a simple pole at z=0 where the height is infinite and the colors converge but cycle clockwise. There is also a saddle point at z=-1, and the branch cuts occur at the red-blue boundary:

ComplexPlot3D[z+(1/z),{z,-2-2I,2+2I},ColorFunction->"DarkRainbow",PlotLegends->Automatic]

The following plot shows a function with simple zeros at z=-1±i, a double pole at z=1 and a saddle point at z=-(3/2):

ComplexPlot3D[((10((z^2)+2z+2))/(((z-1))^2)),{z,-2-2I,2+2I},ColorFunction->"CyclicLogAbs",ScalingFunctions->"Log"]

OpenersExampleSubsection26(Spacer1)Other Applications  (16)

OpenersExampleSubsubsection0(Spacer1)Classic  (2)

Reproduce the famous complex plot by Janhke and Emde (Tables of Functions with Formulas and Curves, 4th ed., Dover, 1945):

ComplexPlot3D[Gamma[z],{z,-4.5-2.5I,4.5+2.5I},Filling->Bottom,PlotRange->{0,6},PlotPoints->50,Exclusions->None,Mesh->{Join[10^Range[-4,0,0.5],Range[0,6,0.5]],Range[-Pi,Pi,Pi/6]},ViewPoint->{-.8,-3,1},Boxed->False,AxesOrigin->{0,0,0},AxesLabel->{"x","y","z"}]

Produce a 3D version of the famous complex plot by Janhke and Emde (Tables of Functions with Formulas and Curves, 4th ed., Dover, 1945):

ComplexPlot3D[BesselJ[0,z]+I BesselY[0,z],{z,-4-1.5I,2+1.5I},Mesh->Automatic,PlotRange->{0,4},BoxRatios->{2,1,(4/3)},ViewPoint->Above]

OpenersExampleSubsubsection1(Spacer1)General  (6)

Plot complex functions of a complex variable:

ComplexPlot3D[Cos[z],{z,-2Pi-3I,2Pi+3I},ColorFunction->"CyclicLogAbsArg",ScalingFunctions->"Log"]

Visualize features of a complex function of a complex variable. The following plot indicates a triple zero at z=-1-i, simple zeros z=±i, a simple pole at z=1 and a double pole at z=-1:

ComplexPlot3D[(((((z+1+I))^3)((z^2)+1)Exp[3/z])/((((z-1))^2)(z+1))),{z,-2-2I,2+2I},PlotRange->{0,(10^4)}]

Examine roots of unity:

Manipulate[ComplexPlot3D[(z^n)-1,{z,-2-2 I,2+2 I},ScalingFunctions->"Log"],{n,2,20,1}]

See the five real roots of (Subscript[T, 5]) in [-1,1]:

ComplexPlot3D[ChebyshevT[5,z],{z,-1.5-1.5 I,1.5+1.5 I},ColorFunction->"CyclicLogAbs",ScalingFunctions->"Log",ViewPoint->{1,-2.4,0.8}]

Plots of partial sums of the geometric series suggest that the infinite series diverges for (Abs[z])≥1:

Manipulate[ComplexPlot3D[Sum[(z^k),{k,0,kmax}],{z,-2-2 I,2+2 I},ColorFunction->"CyclicLogAbs",ScalingFunctions->"Log"],{{kmax,10,"max k"},1,35,1}]

Visualize Möbius transformations:

ComplexPlot3D[((z-2+2I)/(-3+3I-z)),{z,-5-5 I,5+5 I},PlotPoints->50,Mesh->20,MeshStyle->{Directive[Thick,White],Black},MeshFunctions->{Log[Abs[#2]]&,Arg[#2]&},Exclusions->None]

OpenersExampleSubsubsection2(Spacer1)Special Functions  (2)

Plot special functions:

ComplexPlot3D[Erf[z],{z,-5-5 I,5+5 I},ScalingFunctions->"Log10"]

ComplexPlot3D[(((Gamma[z-I])^2)/((Gamma[z+I])^2)),{z,-5.5-2I,2+2I},ColorFunction->"ShiftedCyclicLogAbs",ScalingFunctions->"Log"]

A visual reminder that (RefLink[Log, paclet:ref/Log])[(z^2)]==2(RefLink[Log, paclet:ref/Log])[z] for (RefLink[Re, paclet:ref/Re])[z]>0, but not for (RefLink[Re, paclet:ref/Re])[z]≤0:

{ComplexPlot3D[Log[(z^2)],{z,-2-2I,2+2I}],ComplexPlot3D[2Log[z],{z,-2-2I,2+2I}]}

OpenersExampleSubsubsection3(Spacer1)Analytic Functions  (2)

A conformal map preserves angles:

ComplexPlot3D[Sin[z/2],{z,-4-4I,4+4I},Mesh->20,MeshFunctions->{Re[#2]&,Im[#2]&},MeshShading->{{White, Black},{Black,White}}]

Compare the enhanced phase portraits of analytic and nonanalytic functions:

{ComplexPlot3D[(((z^2)+1)/((z^2)-1)),{z,-2-2I,2+2I},ColorFunction->"CyclicLogAbsArg"],
ComplexPlot3D[(((z^2)+1)/(((Conjugate[z])^2)-1)),{z,-2-2I,2+2I},ColorFunction->"CyclicLogAbsArg"]}

OpenersExampleSubsubsection4(Spacer1)Physics  (2)

Plot the field lines (black) and the potential lines (white) for two point charges of equal but opposite charge at z=±1:

ComplexPlot3D[((z+1)/(z-1)),{z,-3-3I,3+3I},Exclusions->None,PlotPoints->40,Mesh->30,MeshFunctions->{Log10[Abs[#2]]&,Arg[#2]&},MeshStyle->{White,Black},ColorFunction->"GlobalAbs",ViewPoint->{0,0,2}]

Plot a complex fluid velocity potential with corresponding streamlines for flow external to a corner:

ComplexPlot3D[(((-I z))^(2/3))-(((-z))^(2/3)),{z,-3-3I,3+3I},Mesh->{Range[0,3,.2]},MeshFunctions->{Im[#2]&},RegionFunction->Function[{z},Arg[z]<-π/2||Arg[z]>0],BoundaryStyle->None]

OpenersExampleSubsubsection5(Spacer1)Transforms  (2)

Plot Fourier transforms:

ft=FourierTransform[Exp[-(x^2)]UnitStep[x],x,ω]

ComplexPlot3D[Evaluate[ft],{ω,-10-10I,10+0I},ScalingFunctions->"Log"]

Plot Laplace transforms:

lt=LaplaceTransform[(t^2) SawtoothWave[t/2],t,s]//Apart

ComplexPlot3D[Evaluate[lt],{s,-10-15I,20+15I},ScalingFunctions->"Log"]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[ComplexPlot, paclet:ref/ComplexPlot])  ▪  (RefLink[AbsArgPlot, paclet:ref/AbsArgPlot])  ▪  (RefLink[ReImPlot, paclet:ref/ReImPlot])  ▪  (RefLink[Plot3D, paclet:ref/Plot3D])  ▪  (RefLink[ComplexListPlot, paclet:ref/ComplexListPlot])  ▪  (RefLink[DensityPlot, paclet:ref/DensityPlot])  ▪  (RefLink[ContourPlot, paclet:ref/ContourPlot])  ▪  (RefLink[AbsArg, paclet:ref/AbsArg])  ▪  (RefLink[ReIm, paclet:ref/ReIm])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Function Visualization, paclet:guide/FunctionVisualization])}, {▪(RefLinkPlain[Functions of Complex Variables, paclet:guide/FunctionsOfComplexVariables])}, {▪(RefLinkPlain[Complex Visualization, paclet:guide/ComplexVisualization])}})}})