# How to plot complex functions on the paper by your hand?

I want to know the exact method of plotting complex function used by human, computer, and whatever who can do mathematics. For example how should I plot this : $w = u+iv$ , $z = x+iy$ , $w= f(z)= z^2$ I'm completely confused imagining the complex functions and I want to know how you would imagine such functions and do mathematics with it. Thanks in advance

• Do you understand that you can't plot functions from $\mathbb R^2$ to $\mathbb R^2$? Dec 28, 2013 at 19:47
• No, you mean it's not possible to plot such function? Dec 28, 2013 at 19:47
• Yes, it isn't possible to plot such functions in the traditional sense of 'plot'. Dec 28, 2013 at 19:49
• @MrWho You can't plot from $\mathbb R^2$ to $\mathbb R^2$ for the reason mathematics2x2life gives in his answer. See this link for a different way of plotting functions. Dec 28, 2013 at 19:53
• Does this answer your question? What free tools can I use to plot complex functions on the complex plane? Apr 3, 2022 at 17:35

You don't plot these. To plot them would require $2$ axes to plot the real and imaginary components of the inputs and they it would require another $2$ axes to plot the real and imaginary components of the outputs, totaling $4$ axes. However, we are unable to plot in $4$-dimensions in our $3$ dimensional world. So we must make a choice: plot the imaginary part of the output or the real part of the output. For example, take the function $f(z)=z^2$. Then we have $$f(2+i)=(2+i)^2=4+4i-1=3+4i$$ We could then plot the imaginary part of the output, $4i$. So this would be the same as plotting the point $(2,1,4)$ in $\mathbb{R}^3$.

NOTE. This isn't the only thing we could plot. For example, another common choice is to plot the absolute value of the output. In our example above, we would have $f(2+i)=3+4i$. Then we know that $|3+4i|=\sqrt{25}=5$. So we would plot the point $(2,1,5)$. It all depends on the choice of the final variable to plot while the $2$ first axes are almost always the real and imaginary components of the input, respectively.

• What's the problem? Couldn't we plot (2,1,4) in the R^3?! Dec 28, 2013 at 19:55
• Yes, we could and we do. That's the point. We can plot that but we cannot plot the point $(2,1,3,4)$ which would be needed to properly visualize the output of $f(2+i)$ in my example. Dec 28, 2013 at 19:57
• Plotting complex function is still hard for me to grasp! Dec 31, 2013 at 21:01
• It should be given that it is humanly impossible to do as it needs to be done, as I explained. Moreover, it's not that important in Complex Analysis as even if we do plot, it is a computer program that does the work for us. More important to learn the theory like the Cauchy-Goursat Theorem, Residue Theorem, Cauchy Integral Formula, etc. Dec 31, 2013 at 23:23
• However, I want to have geometric imagination of what I'm really doing, if you know any article or something which has explained plotting clearly please let me know. Jan 1, 2014 at 10:31

I just wanted to point out that I wrote a Python package, cplot, that makes plotting complex-valued functions fairly simple. It combines domain coloring and contour lines for constant arg/abs. e.g., for $$\sin(z)/z$$:

import cplot
import numpy as np

def f(z):
return np.sin(z) / z

plt = cplot.plot(f, (-7.0, +7.0, 400), (-7.0, +7.0, 400))
plt.show() You can plot such functions! Look at https://people.math.osu.edu/fowler.291/phase/

for instance. The color at a point tells you the phase of the image of that point. To see what the base "phase chart" is, just plot the identity function $z$.

If you wanted phase and modulus info, you could do a 3D plot colored by phase. I did that too using webGL and cannot find it now. Will update this later when I do...

Like Steven Gubkin says, coloring by phase can give you excellent geometric intuitions. I put together this Python code while I was taking complex analysis, let me know what you think: https://github.com/seaplant3/complex-plotting

It uses contours (like an elevation map) to show magnitude, I found that was the easiest way to keep everything visible.

• While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review Jan 22, 2018 at 7:49
• What 'essential parts of the answer' are missing? Jan 22, 2018 at 8:12
• Your relevant Python code, in case the link changes/goes down. Jan 22, 2018 at 18:51