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:
Customize help among groups in argparse
How to read line and remove line in Python?
List of lists; how do I concatenate each value to a new list? [duplicate]
Override operator in two different ways (Python 2.7) [duplicate]
How to get a specific response by using suds module for soap request?
How to find a set of values from a list of lists which contains no repetitions
filter hyperlinks - python
Get movie information from IMDb API website
super() method resolution in python
i need to add time to the python key logger [duplicate]
Python and regex to find a number of length 5
Django REST same API for different countries
How to pass boost::none to Python Quantlib
How to get list from list of list of tuples in python
How can I distribute my python desktop application?
How to load images and labels to image_data_layer using Python?