Python Forum
Mandelbrot set in Python
Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mandelbrot set in Python
#6
I was kinda in rush, that's why I bumped, sorry for that.

import matplotlib.pyplot as plt


def funkcja(c=0j, z=0 + 0j, n_max=100):
    for i in range(n_max):
        z = z * z + c
        if abs(z) > 2.0:
            T[i][j] = abs(z)
        break

k = 600
l = 600

T = [[0]*l for i in range(k)]

for i in range(k):
    for j in range(l):
        T = [(complex(-2 + i * 0.005, -1.5 + j * 0.005))]



plt.imshow(T, cmap="bone")
plt.show()
Came up before with this, still, don't really know how to excecute the numbers I need for final product. I get an error: TypeError: Image data of dtype complex128 cannot be converted to float. What do I need to change?
Reply


Messages In This Thread
Mandelbrot set in Python - by Snorku - May-18-2020, 01:02 PM
RE: Mandelbrot set in Python - by Snorku - May-20-2020, 08:52 AM
RE: Mandelbrot set in Python - by GOTO10 - May-20-2020, 02:51 PM
RE: Mandelbrot set in Python - by jefsummers - May-20-2020, 03:34 PM
RE: Mandelbrot set in Python - by deanhystad - May-21-2020, 08:07 AM
RE: Mandelbrot set in Python - by Snorku - May-21-2020, 08:59 PM
RE: Mandelbrot set in Python - by deanhystad - May-22-2020, 12:13 PM
RE: Mandelbrot set in Python - by Snorku - May-22-2020, 07:46 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020