In [26]:
import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
In [27]:
e = np.array([0, 0.1, 1.0, 0.1, 0])
plt.plot(e, '-bo', ms=10, lw=4, clip_on=False)
plt.gca().set_ylim([0,1])
plt.axis('off')
Out[27]:
(0.0, 4.0, 0.0, 1.0)
In [28]:
eold = e.copy()
e[2] = 0.5 * (e[1] + e[3])
plt.plot(eold, '-bo', ms=10, lw=4, clip_on=False)
plt.plot(e, '-rx', ms=10, lw=4, clip_on=False)
plt.gca().set_ylim([0,1])
plt.axis('off')
Out[28]:
(0.0, 4.0, 0.0, 1.0)
In [29]:
e = np.array([0, 0.1, 0.15, 0.1, 0])
plt.plot(e, '-bo', ms=10, lw=4, clip_on=False)
plt.gca().set_ylim([0,1])
plt.axis('off')
Out[29]:
(0.0, 4.0, 0.0, 1.0)
In [30]:
eold = e.copy()
e[2] = 0.5 * (e[1] + e[3])
plt.plot(eold, '-bo', ms=10, lw=4, clip_on=False)
plt.plot(e, '-rx', ms=10, lw=4, clip_on=False)
plt.gca().set_ylim([0,1])
plt.axis('off')
Out[30]:
(0.0, 4.0, 0.0, 1.0)
In [33]:
e = np.array([-1, 1, -1, 1, -1, 1])
plt.plot(e, '-bo', ms=10, lw=4, clip_on=False)
plt.gca().set_ylim([-1,1])
plt.axis('off')
Out[33]:
(0.0, 5.0, -1.0, 1.0)
In [34]:
eold = e.copy()

e[0] = 0.5 * (eold[-1] + eold[1])
e[1] = 0.5 * (eold[0] + eold[2])
e[2] = 0.5 * (eold[1] + eold[3])
e[3] = 0.5 * (eold[2] + eold[4])
e[4] = 0.5 * (eold[3] + eold[5])
e[5] = 0.5 * (eold[4] + eold[0])

plt.plot(eold, '-bo', ms=10, lw=4, clip_on=False)
plt.plot(e, '-rx', ms=10, lw=4, clip_on=False)
plt.gca().set_ylim([-1,1])
plt.axis('off')
Out[34]:
(0.0, 5.0, -1.0, 1.0)
In [ ]: