Complex Valued Visualization

Nirmal Malapaka
Wolfram Research

Join the Conversation #WolframTechConf

Introduction

In version 10 we introduced JuliaSetPlot and MandelbrotSetPlot to visualize the complex plane. In version 12 we are going back to basics and adding a set of five visualization functions to help you explore complex numbers and functions in 2D and 3D.

GraphicsRow[{JuliaSetPlot[0.365-0.37I],MandelbrotSetPlot[]}]

Complex Visualizations

ReImPlot

AbsArgPlot

ComplexListPlot

ComplexPlot

ComplexPlot3D

ReImPlot f: ℝ->ℂ

Plot[Sqrt[x],{x,-1,1},PlotTheme->"Detailed"]

ReImPlot[Sqrt[x],{x,-1,1},PlotLegends->"ReImExpressions",PlotTheme->"Detailed"]

Plot[{Im[Sqrt[x]],Re[Sqrt[x]]},{x,-1,1},PlotTheme->"Detailed"]

ReImPlot[{Sqrt[x],Sqrt[Sin[x]],Exp[1/Sqrt[x]]},{x,-4,4},ReImStyle->{Thick,Dotted},ReImLabels->{Re,Im},PlotTheme->"Detailed"]

AbsArgPlot f: ℝ->ℂ

AbsArgPlot[Sqrt[x],{x,-1,1},PlotLegends->Automatic,ColorFunction->ColorData["Rainbow"],PlotTheme->"Marketing"]

Plot[Abs[Sqrt[x]],{x,-1,1},PlotLegends->Automatic]

Arg[Sqrt[#]]&/@Table[i,{i,-1,1,1/10}]

Plot[Arg[Sqrt[x]],{x,-1,1},ColorFunction->(ColorData["Rainbow"][Rescale[#2,{-Pi,Pi}]]&),PlotTheme->"Marketing",ColorFunctionScaling->False]

AbsArgPlot Color

AbsArgPlot[Zeta[1/2+I t],{t,0,50},PlotLegends->Automatic,PlotTheme->"Detailed",PlotLabels->Placed[Automatic,Above]]

AbsArgPlot[Sin[x]+Sin[I Sin[3x]],{x,-Pi,Pi},PlotTheme->"Detailed",PlotLegends->Automatic,PlotLabels->Placed[Automatic,Above]]

ComplexListPlot

data=Table[Cos[x]+I Sin[x] ,{x,-Pi,Pi,.1}];

ComplexListPlot[data,FrameLabel->{"Real","Imaginary"}]

ListPlot[Thread[{Re[data],Im[data]}],AspectRatio->1]

ComplexListPlot

Graphs solutions of sin(2 z)==cos(sin(z))+1:

roots=NSolve[Sin[2z]==1+Cos[Sin[z]]&&-2π≤Re[z]≤2π&&-2π≤Im[z]≤2π,z];

ComplexListPlot[z/.roots,Ticks->{Range[-2Pi,2Pi,Pi],Range[-2Pi,2Pi,Pi]}]

Show the eigenvalues for a PDE problem. Seek solutions of the structurally damped wave equation

ϵ=.1;
eValues=Flatten[Table[{(1/2) (-(n^2) ϵ-n (Sqrt[-4+(n^2) (ϵ^2)])),(1/2) (-(n^2) ϵ+n (Sqrt[-4+(n^2) (ϵ^2)]))},{n,1,100}]];
ComplexListPlot[eValues,PlotRange->{{-42,1},{-11,11}},PlotStyle->Directive[Red,PointSize[.015]],Epilog->{Gray,Circle[{-(1/ϵ),0},(1/ϵ)]}]

ComplexListPlot Color

ComplexListPlot[RandomComplex[{-1-I,1+I},100000],ColorFunction->(Hue[#3]&)]

ComplexListPlot[RandomComplex[{-1-I,1+I},100000],ColorFunction->(Hue[Rescale[Arg[#+I #2],{0, 2 Pi}]]&)]

ComplexListPlot[RandomComplex[{-1-I,1+I},100000],ColorFunction->(Hue[Rescale[Arg[1/(#+I #2)],{0, 2 Pi}]]&)]

ComplexPlot f: ℂ->ℂ

Colors

ComplexPlot[z,{z,-1-I,1+I},ColorFunction->None]

ComplexPlot[1/z,{z,-1-I,1+I},ColorFunction->None]

ComplexPlot Zeros

Grid[{{,,,,},TextCell[#,18,Bold,FontFamily->"Helvetica"]&/@{"Zero",Column[{"Multiple ","Zero"}],"Pole",Column[{"Multiple ","Pole"}],Column[{"Essential ","Singularity"}]}},Spacings->{3, 1}]

Zeros

GraphicsRow@Table[ComplexPlot[z^a,{z,-1-I,1+I},ColorFunction->None],{a,2,4,1}]

Manipulate[ComplexPlot[z^4+a^4 ,{z,-1-I,1+I}],{a,0,1}]

ComplexPlot Poles and Singularities

Poles

GraphicsRow[ComplexPlot[#,{z,-1-I,1+I},PlotLabel->#2]&@@@{{z, "Zero"},{1/z,"Pole"}}]

Singularities

Grid[{{ComplexPlot[Exp[(1-I)/z]^3,{z,-1-I,1+I},ColorFunction->None,ImageSize->300],Quiet@Plot3D[Arg[Exp[(1-I)/(x+I y)]^3],{x,-2,2},{y,-2,2},ColorFunction->Hue,PlotRange->All,ImageSize->300]}}]

ComplexPlot

ComplexPlot[z,{z,-1-I,1+I},PlotLegends->Automatic,ColorFunction->None]

ComplexPlot[z,{z,-1-I,1+I},ColorFunction->{None,Automatic},PlotLegends->Automatic]

Plot3D[Abs[x+I y],{x,-1,1},{y,-1,1},ColorFunction->Hue]

ComplexPlot[z,{z,-1-I,1+I},PlotLegends->Automatic]

ComplexPlot Shading

ComplexPlot Shading

Grid[Partition[ComplexPlot[z,{z,-1-I,1+I},ColorFunction->#,PlotLabel->#]&/@{"MaxAbs","LocalMaxAbs","GlobalAbs","QuantileAbs","CyclicLogAbs","CyclicArg","CyclicLogAbsArg","CyclicReImLogAbs","ShiftedCyclicLogAbs"},3]]

ComplexPlot3D f: ℂ->ℂ

ComplexPlot3D[z,{z,-1-I,1+I},ColorFunction->None,PlotLegends->Automatic]

Plot3D[Abs[x+I y],{x,-1,1},{y,-1,1}]

Plot3D[Arg[x+I y],{x,-Pi,Pi},{y,-Pi,Pi},Exclusions->None]

ComplexPlot3D[z,{z,-1-I,1+I},ColorFunction->{"AvocadoColors",None},PlotLegends->Automatic]

ComplexPlot3D Mesh

Grid[Partition[ComplexPlot3D[(z^2)+I,{z,-3-3I,3+3I},Mesh->Automatic,MeshFunctions->(#2),PlotLabel->#,ImageSize->Medium]&@@@{{"Real", #1&},{"Imaginary", #2&},{"Abs", #3&},{"Arg", #4&}},2]]

Join the Conversation #WolframTechConf

$PlotTheme="Detailed"