title: Coupled map lattice in Python
body: <p>I attempt to plot bifurcation diagram for following one-dimensional spatially extended system with boundary conditions</p>
  
  <pre><code>x[i,n+1] = (1-eps)*(r*x[i,n]*(1-x[i,n])) + 0.5*eps*( r*x[i-1,n]*(1-x[i-1,n]) + r*x[i+1,n]*(1-x[i+1,n])) + p
  </code></pre>
  
  <p>I am facing problem in getting desired output figure may be because of number of transients I am using. Can someone help me out by cross-checking my code, what values of nTransients should I choose or how many transients should I ignore ?</p>
  
  <p>My Python code is as follows:</p>
  
  <pre><code>import numpy as np
  from numpy import *
  from pylab import *
  
  L = 60      # no. of lattice sites
  eps = 0.6   # diffusive coupling strength
  r = 4.0     # control parameter r
  
  np.random.seed(1010)
  ic = np.random.uniform(0.1, 0.9, L) # random initial condition betn. (0,1)
  
  nTransients = 900 # The iterates we'll throw away
  nIterates = 1000 # This sets how much the attractor is filled in
  nSteps = 400 # This sets how dense the bifurcation diagram will be
  
  pLow = -0.4
  pHigh = 0.0
  pInc = (pHigh-pLow)/float(nSteps)
  
  def LM(p, x):
      x_new = []
      for i in range(L):
          if i==0:
              x_new.append((1-eps)*(r*x[i]*(1-x[i])) + 0.5*eps*(r*x[L-1]*(1-x[L-1]) + r*x[i+1]*(1-x[i+1])) + p)
          elif i==L-1:
              x_new.append((1-eps)*(r*x[i]*(1-x[i])) + 0.5*eps*(r*x[i-1]*(1-x[i-1]) + r*x[0]*(1-x[0])) + p)
          elif i&gt;0 and i&lt;L-1:
              x_new.append((1-eps)*(r*x[i]*(1-x[i])) + 0.5*eps*(r*x[i-1]*(1-x[i-1]) + r*x[i+1]*(1-x[i+1])) + p)
      return x_new
  
  for p in arange(pLow, pHigh, pInc):
      # set initial conditions
      state = ic
      # throw away the transient iterations
      for i in range(nTransients):
          state = LM(p, state)
      # now stote the next batch of iterates
      psweep = []     # store p values
      x = []          # store iterates
      for i in range(nIterates):
          state = LM(p, state)
          psweep.append(p)
          x.append(state[L/2-1])
      plot(psweep, x, 'k,')   # Plot the list of (r,x) pairs as pixels
  
  xlabel('Pinning Strength p')
  ylabel('X(L/2)')
  
  # Display plot in window
  show()
  </code></pre>
  
  <p>Can someone also tell me figure displayed by pylab in the end has either dots or lines as a marker, if it is lines then how to get plot with dots.</p>
  
  <p>This is my output image for reference, after using pixels:</p>
  
  <p><a href="https://i.stack.imgur.com/xb8qb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xb8qb.png" alt="Reference picture"></a></p>