We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.

I hate garbage code • 3 months ago

It got executed perfectly. Too bad it literally does nothing.

Rapitharian • 1 month ago

It creates an image file called output in the folder/directory your .py file is run from.

Greg • 3 months ago

One suggestion for extending the tool: Add a constant called NODES = 1, and replace "x=x*x+c" with "x=x^(NODES+1)+c".

This is because the standard Mandlebrot set is based on "X^2+C", but incrementing that exponent to X^n gives you n-1 nodes as the result. I replicated this by just adding more x's to the code above, but since most people don't know that property of the set, it would be an easy way for them to play with it.

Rapitharian • 1 month ago

Proper notation to get this to work in Python 3.7 is "x=x**(NODES+1)+c" ** is the notation for exponent in python.

Leszkon • 5 months ago

Thanks! I was struggling to understand The Mandelbrot Set, but now it's all clear.

Anonymous • 6 months ago

I am not a programmer, but I am trying to get this code to work, the interpreter returned this line a syntax error,

color = 255 - int(m * 255 / MAX_ITER)

Im running Python 3.8.2, thank you in advance to anyone for their assistance. Nick

Ps, I'm working my way through this. The above issue has been solved; now on to the next issue! :)

Anonymous • 7 months ago

I got this error:
from mandelbrot import mandelbrot, MAX_ITER
ModuleNotFoundError: No module named 'mandelbrot'

I use Google Colab.
Thanks,

kopfarzt • 7 months ago

Please note, that there are sources for two .py files plot.py and mandelbrot.py (see the tabs in the source code window). You should store both into the same folder/project.

me • 1 year ago

why does it not work in python 3.8

Ron • 1 year ago

When I run your first 2 examples, the smoothed mandelbrot does not look any different.

vayu • 2 years ago

In the max_iter program it seems like you're going from -1 to 1. In the bw plot.py it seems like the real part RE_START, RE_END goes from -2 to 1 but the imagineary part IM_START, IM_END goes from -1 to 1. I was under the impression that the Mandelbrot set lies in the coordinate space of -1 to 1. Is that true?, if so why does the real part go from -2 to 1?

vayu • 2 years ago

EDIT* Never mind, It works great with python3.

When I copy the two files plot.py and mandelbrot.py to my local computer I get an all white image for the black and white code and and all red image for the color code. I have pil installed. Am I missing something?

Anonymous • 3 years ago

Is it ok if I don't understand this in the 8th grade?

[CG]Maxime • 3 years ago

That's perfectly ok, you need to learn what's a coordinate system, a sequence and what is a complex number. Feel free to ask questions!