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:
Migrating python with selenium from mac to pc
Is there a Haskell equivalent to Python's `shelve` for transparent persistence?
Module object differences in 2 versions of Sublime Text
Python's function scope [duplicate]
MultiIndex from product of unique values of two indexes
Sorting a list of jagged (non-normal) tuples in python [duplicate]
Python - calculator program and strings
how can the qml files in qrc import plugins
PySide / Qt Import Error
How do you execute a terminal command and then repeatedly check and store the response in Python?
Grouping unique items in a python list when only equality comparison is possible
How to loop this so I can add more twitter accounts
flask sub function not yielding results
Django - Rest-framework: After Deployment to a remote server wrong results
PythonAnywhere install new module for 2.7
How to extract substring with base part of path string