0
$\begingroup$

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?

One implementation would be to partition the output into 3 lists of 2-tuples depending on the 3rd component and then use ListPlot on those 3 lists and manually define the color. There must be a better way.

$\endgroup$
3
  • $\begingroup$ Have you seen this? $\endgroup$
    – J. M.'s torpor
    Mar 29 '18 at 23:58
  • $\begingroup$ Thx, @J.M., I have looked at this and other locations on this site for creating Newton's Method fractals. Ultimately, I would like to investigate Newton's fractal when the function is Zeta[z]. All of the implementations Ive found here fail for one reason or another. For some reason there is a problem with compile and a basic implementation e.g. mathematica.stackexchange.com/questions/100053/… is too slow to be useful. The above implementation actually works with Zeta[z] but I need to get some control using the output for plotting. $\endgroup$
    – JEM
    Mar 30 '18 at 0:29
  • $\begingroup$ Ah, you definitely can't compile Zeta[], so trying to make a fractal out of that will likely be slow. $\endgroup$
    – J. M.'s torpor
    Mar 30 '18 at 0:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.