Is there any good way how to plot 2D array of complex numbers as image in mathplotlib ?
It makes very much sense to map magnitude of complex number as \"brightness\" or
The library mpmath uses matplotlib
to produce beautiful images of the complex plane. On the complex plane you usually care about the poles, so the argument of the function gives the color (hence poles will make a spiral). Regions of extremely large or small values are controlled by the saturation. From the docs:
By default, the complex argument (phase) is shown as color (hue) and the magnitude is show as brightness. You can also supply a custom color function (color). This function should take a complex number as input and return an RGB 3-tuple containing floats in the range 0.0-1.0.
Example:
import mpmath
mpmath.cplot(mpmath.gamma, points=100000)
Another example showing the zeta function, the trivial zeros and the critical strip:
import mpmath
mpmath.cplot(mpmath.zeta, [-45,5],[-25,25], points=100000)