Skip to main content
Source Link

Plotting points in the complex plane can be easily arranged, like so:

rootPlot[poly_, x_, opts___] /; PolynomialQ[poly, x] := 
      ListPlot[Map[Composition[Through, {Re, Im}], x /. NSolve[poly, x]],
               opts, AspectRatio -> Automatic]

An example:

rootPlot[x^4 + x, x, Axes -> None, Frame -> True, PlotStyle -> AbsolutePointSize[6]]

roots of a polynomial

Notes:

  • Map[Composition[Through, {Re, Im}], roots] turns your list of complex numbers into a pair consisting of the real and imaginary parts, which can be easily processed by ListPlot[].

  • Since you're just plotting them, you don't really need to go symbolic; NSolve[] is a bit quicker to use than Solve[].

Post Made Community Wiki by J. M.'s missing motivation