We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.
It got executed perfectly. Too bad it literally does nothing.
It creates an image file called output in the folder/directory your .py file is run from.
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.
Proper notation to get this to work in Python 3.7 is "x=x**(NODES+1)+c" ** is the notation for exponent in python.
Thanks! I was struggling to understand The Mandelbrot Set, but now it's all clear.
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! :)
I got this error:from mandelbrot import mandelbrot, MAX_ITERModuleNotFoundError: No module named 'mandelbrot'
I use Google Colab.Thanks,
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.
why does it not work in python 3.8
When I run your first 2 examples, the smoothed mandelbrot does not look any different.
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?
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?
Is it ok if I don't understand this in the 8th grade?
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!