11
$\begingroup$

Possible Duplicate:
Plotting an Argand Diagram

How do I plot complex numbers in Mathematica? The following is a part of my data, the eigen values of a 50 by 50 asymmetric matrix:

 2.183, 2.1726 + 0.081626 I, 2.1726 - 0.081626 I, 
 2.14149 + 0.161732 I, 2.14149 - 0.161732 I, 2.09002 + 0.238883 I, 
 2.09002 - 0.238883 I, 2.01881 + 0.311781 I, 2.01881 - 0.311781 I, 
 1.92881 + 0.379272 I, 1.92881 - 0.379272 I, 1.8213 + 0.440343 I, 
 1.8213 - 0.440343 I, 1.69787 + 0.494111 I, 1.69787 - 0.494111 I, 
 1.56041 + 0.539817 I, 1.56041 - 0.539817 I, 1.41104 + 0.57683 I, 
 1.41104 - 0.57683 I, 1.25211 + 0.60465 I, 1.25211 - 0.60465 I

I can extract the real and Imaginary parts using the commands with

Im[Eigenvalues[mtrx1]] 

and

Re[Eigenvalues[mtrx1]]

but then could not see how to pair up the real and imaginary parts in order to make a plot. Please help

$\endgroup$
5
  • $\begingroup$ You could plot Abs and/or Re and/or Im on the same plot. $\endgroup$ Commented Dec 13, 2012 at 12:18
  • $\begingroup$ Alernatively you can pair up the real and imaginary parts with the following: data=Tranpose[{Re[Eigenvalues[mtrx1]],Im[Eigenvalues[mtrx1]]}]. $\endgroup$ Commented Dec 13, 2012 at 13:17
  • $\begingroup$ Welcome to Mathematica.Stackexchange ! Consider registering your account. Take a look at a related question mathematica.stackexchange.com/questions/15637/… $\endgroup$
    – Artes
    Commented Dec 13, 2012 at 13:35
  • 1
    $\begingroup$ Similar: mathematica.stackexchange.com/q/3458/57 $\endgroup$ Commented Dec 13, 2012 at 15:08
  • $\begingroup$ Asymmetric in what sense? Obviously not skew-symmetric (or, anti-symmetric if your in physics) as the eigenvalues are not purely imaginary, but I'm wondering if the symmetry would be conducive to some other means of plotting. $\endgroup$
    – rcollyer
    Commented Dec 13, 2012 at 15:37

2 Answers 2

22
$\begingroup$
data = Table[RandomReal[{-1, 1}] + I RandomReal[{-1, 1}], {30}];

p = ListPlot[{Re[#], Im[#]} & /@ data,
   AxesOrigin -> {0, 0},
   PlotRange -> {{-1.2, 1.2}, {-1.2, 1.2}},
   ImagePadding -> 40,
   AspectRatio -> 1,
   Frame -> True,
   FrameLabel -> {{Im, None}, {Re, "complex plane"}},
   PlotStyle -> Directive[Red, PointSize[.02]]];

Show[p, Graphics@Circle[{0, 0}, 1]]

enter image description here

$\endgroup$
1
  • $\begingroup$ In the current version, one can just do ListPlot[ReIm[data]]. $\endgroup$ Commented Nov 29, 2019 at 21:14
1
$\begingroup$

If you have complex numbers and you want to plot them as points in the complex plane, it seems strange, doesn't it, to have to first pull them apart into real and imaginary parts? If you use David Park's Presentations add-on, you need not---you may treat complex numbers as such (just like everywhere else in Mathematica but in the oddly exceptional case of plotting!):

data = {2.183, 2.1726 + 0.081626 I, 2.1726 - 0.081626 I, 
    2.14149 + 0.161732 I, 2.14149 - 0.161732 I, 2.09002 + 0.238883 I, 
    2.09002 - 0.238883 I, 2.01881 + 0.311781 I, 2.01881 - 0.311781 I, 
    1.92881 + 0.379272 I, 1.92881 - 0.379272 I, 1.8213 + 0.440343 I, 
    1.8213 - 0.440343 I, 1.69787 + 0.494111 I, 1.69787 - 0.494111 I, 
    1.56041 + 0.539817 I, 1.56041 - 0.539817 I, 1.41104 + 0.57683 I, 
    1.41104 - 0.57683 I, 1.25211 + 0.60465 I, 1.25211 - 0.60465 I};

<< Presentations`

Draw2D[{PointSize -> Large, Red, ComplexPoint /@ data}, Axes -> True]

(Sorry, SE Uploader for the image isn't working due to some kind of Java error.)

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.