I donโt know for sure that you are here ... do you have a set of complex numbers and you want to match them to a plane, using their real part as x coordinate and imaginary part as y?
If so, you can get the real part of the python imaginary number with number.real and the imaginary part with number.imag . If you use numpy, it also provides a set of helper functions numpy.real and numpy.imag, etc. that work with numpy arrays.
So, for example, if you had an array of complex numbers that stores something like this:
In [13]: a = n.arange(5) + 1j*n.arange(6,11) In [14]: a Out[14]: array([ 0. +6.j, 1. +7.j, 2. +8.j, 3. +9.j, 4.+10.j])
... you can just do
In [15]: fig,ax = subplots() In [16]: ax.scatter(a.real,a.imag)
This displays the points in the argand diagram for each point.
edit: for the part of the drawing, you should of course import matplotlib.pyplot via from matplotlib.pyplot import * or (like me) use the ipython shell in pylab mode.
inclement
source share