Skip to main content
1 of 2
JEM
  • 1.2k
  • 6
  • 15

Defining a color scheme from part of a list

I have here an implementation of Newton's method that returns a list of 3-vectors. The first and second elements are the real and imaginary parts of the initial conditions and the third element is the results of Newton's method:

Newton[z_Complex] := z - (z^3 + 1)/(3 z^2);
Table[{n, m , NestWhile[Newton[#] &, n + m I, Abs[#] <= 20 &, All, 50]}, {n, -2, 2, .1}, {m, -2, 2, .1}]

What would be an efficient way of plotting the data and assigning a color depending on the 3rd component of each 3-vector? Could we build the specifications directly into the function ListPlot?

JEM
  • 1.2k
  • 6
  • 15