''' one simple iterated exponentiation ...^i^i^i in complex plane ''' import numpy as np import matplotlib.pyplot as plt # prepare plot and calculation c = 0+1j # imaginary unit m = 5000 # points in iteration z = c # starting point of iteration # prepare plot frame and description plt.figure(figsize=(10,6.8)) plt.xlabel('Re',fontsize=14) plt.ylabel('Im',fontsize=14) plt.title('...z^z^z, z='+str(c),fontsize=14) plt.axis([-0.2, 1.1, -0.5, 1.2]) plt.grid(True,color=(.75,.9,.97)) # iterate and plot points one by one for n in range(m): # prepare RGB color index and line weight of the next point f = (n/m)**0.6; lw = 1.*(1.05-f) r = f*0.5 +0.5; g = f*0.7; b = (1-f)*.3 + 0.1 # plot singe point plt.scatter(np.real(z),np.imag(z),s=6,color=(r,g,b),linewidth=lw) # the iteration z = c**z # exponentiation done right (c**z, not z**c) # break out from loop if iteration diverges, |z| > some value if(abs(z) > 999.): break # after iteration, show plot on screen plt.show()