How can I colour this Mandelbrot set?
This Mandelbrot set I created works well although I don't know how to colour like other ones on places like Wikipedia. My version is just plain yellow (see below). from graphics import * zoom = 0.1 xOffset = -0.171 yOffset = 0.61 def mandelbrot(spacing, maxIterations, width, height): win = GraphWin("Mandelbrot",width,height) win.setBackground('black') for x in range(0,width,spacing): for y in range(0,height,spacing): a = ((x / width) * zoom) - xOffset b = ((y / height) * zoom) - yOffset pt = Point(x,y) n = 0 coordA = a coordB = b while(n<maxIterations): aa = a * a - b * b bb = 2 * a * b a = aa + coordA b = bb + coordB n+=1 colourR = int(round(n/maxIterations * 255)) colourB = 255-colourR if(abs(a+b) > 2): break pt.setFill(color_rgb(colourR, colourR, 0)) pt.draw(win) mandelbrot(1,2000,700,700) Image:
how to choose python version accordingly in pycharm?
Unable to import Flask to Kivy iOS
Unique list without spliting entries based on spaces in python
Uncaught SyntaxError: Unexpected token & error for flask and html
Django celery tasks working very long
Python, create plot from DataFrame
having this error TypeError: cannot concatenate 'str' and 'int' objects when trying to do math with variables stored with pickle
Pygame Tone Generator [duplicate]
Django - custom userprofile NoSuchTable error
How do you name a new instance of a class when you don't know what the name is in advance? [duplicate]
python podSixNet - data not sent from server to client
How can I press the Enter key on Selenium using Python without finding an element?
while creating the runbook as draft using azure REST api in python i am facing the error…!
Pick a free port number on localhost using Python, but avoid 1 specific port number
Python split dictionary key at comma
Python-pptx for Python 3.5.1