import numpy as np
def g(x):
return np.cos(1.89*x)
t= np.arange(-1,1.5,0.1)
x=np.zeros((20,1))
plt.plot(t,t)
plt.plot(t,g(t))
for k in [1,2 ,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]:
x[k+1] = g(x[k])
a = [x[k],x[k],x[k],x[k+1]]
b = [x[k],x[k+1],x[k+1],x[k+1]]
plt.plot(a,b, ' -o')