python


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:

Related Links

how to post in facebook group that's im member on it using facebook-sdk python
How to chunk up an interval in Python?
How to merge multiple dictionaries
Ubuntu does not find module directory containing __init__.py
How to detect frequencies with matplotlib spectrogram?
Python timeout decorator
boto3 changing AWS ec2 instance state
Inputing date using Selenium/Python does not work
Opening IDLE from Terminal
IP proto field number to string
Setting all dictionary elements to 0 python
Translate curl to python [duplicate]
Setting Values Of Inherited Properties
How do I make pip install binaries to a writable path?
TensorFlow: generating a random constant
How can I organize my functions to get something like class.draw.line() instead of class.drawLine

Categories

HOME
sas
ember.js
crate
meshlab
freepascal
wxwidgets
mapbox-gl-js
transparent
phpstorm
vlc
java-home
devstack
gimp
ipfs
vuex
getorgchart
intellij-plugin
cross-platform
jquery-terminal
alfresco-share
off-canvas-menu
eclipselink
rails-activerecord
prediction
apple-tv
dspic
onsen-ui
compare-and-swap
visual-c++-2017
widevine
maximo
image-quality
version-numbering
xilinx-ise
reply
superscript
jackson-dataformat-csv
xor
color-scheme
ksoap
sonarqube-scan
ntfs-mft
control-flow-graph
tango
lumen-5.3
fqdn
recycle-bin
windows-firewall
goquery
jgraph
persistent
dwarf
component-pascal
mbaas
google-maps-ios
jexl
photon-controller
modelattribute
photography
launch
unity3d-editor
shinyjs
barcode-printing
sql-import-wizard
ruby-2.0
firepath
gitweb
radians
uiprogressview
scalar
unsatisfiedlinkerror
com-interop
soda
date-format
group-concat
anythingslider
enyo
subresource-integrity
integral
vine
pylearn
swift2.1
obfuscar
errorprovider
node-inspector
valence
android-looper
indexing-service
jstack
sanitization
convex-polygon
facebook-sdk-3.1
robospice
ng-pattern
nuspec
pep8
snapjs
socketstream
git-filter-branch
icefaces-3
macruby
gdt
parameterization
text-services-framework
fileutils
nagle
j-interop
surefire
file-encodings
google-instant
handheld
divx

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App