Last active
October 30, 2015 08:58
-
-
Save mango314/8fa9b2e65be5119cab4b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm foo*.png | |
convert -delay 10x100 foo*.png foo.gif |
[1] I tried using Python's matplotlib on the logarithm and here is what I got, a kind of starburst pattern. Since the angle jumps between
Perhaps instead of matplotlib.pyplot.contour
the contour lines can be connected with meshgrid
and numpy.where
statements.
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
plt.rcParams['figure.figsize']=4,4
plt.contour(
np.arange(-1,1,0.01),
np.arange(-1,1,0.01),
np.angle(t[...,None] + 1j*t[None,...]) ,
levels = 2*np.pi*np.arange(-1,1,0.025)
)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# plt.contour assumes there are lines between theta = 0 and theta = 2*np.pi | |
import numpy as np | |
import matplotlib.pyplot as plt | |
#%matplotlib inline | |
plt.rcParams['figure.figsize']=7,7 | |
# rm foo*.png | |
# convert foo*.png foo.gif | |
dt = 0.01 | |
L = 5 | |
t = np.arange(-L,L+dt, dt) | |
z = t[...,None]+1j*t[None,...] | |
N = 20 | |
PP = np.polyval(P,z) | |
for k in np.arange(N): | |
print "%02d" %(k) | |
w = np.log(np.exp(2j*np.pi*(k*1.0/N))*PP) | |
ds = 0.05 | |
plt.contour(t, t, w.imag%(2*np.pi), levels = 2*np.pi*np.arange(0,1, ds), colors=('#505050','#707070'), linewidth=1) | |
plt.contour(t, t, w.imag%(2*np.pi), levels = 2*np.pi*np.arange(0,1, 0.5), colors='w', linewidth=50) | |
plt.contour(t, t, w.real, levels = np.arange(0,5,0.1)**1, colors=('#A2D426','#6B6CED')) | |
L = 3 | |
plt.xlim([-L,L]) | |
plt.ylim([-L,L]) | |
#plt.show() | |
plt.savefig('/home/jdm/Documents/math/foo-%02d.png'%(k)) | |
plt.clf() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment