Python
import matplotlib.pyplot as plt

def logmap(r, init, t1, t2):

  lmap = [init]

  for i in range(t1,t2):

    init = r*init*(1-init)

  lmap.append(init)

  return lmap

a1=logmap (3.5,0.4,100,120)

a2=logmap(3.84,0.4,100,120)

b=logmap(3.7,0.4,100,180)

figure, axis = plt.subplots(2)

axis[0].plot(a1, 'r')

axis[0].plot(a2, 'b')

axis [0].legend(['r=3.5', 'r=3.84'])

axis[0].set_xlabel('Iterations')

axis[0].set_ylabel('x Values, initial = 0.4')

axis[1].plot(b)

axis[1].set_xlabel('Iterations')

axis [1].legend(['r=3.7'])

axis[1].set_ylabel('x Values, initial 0.4') 

plt.title('Logistic Map')

plt.show()