title: How to make two sliders in matplotlib
body: <p>I would like to make two sliders in matplotlib to manually change N and P values in my predator-prey model:</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  from scipy.integrate import odeint
  
  def lotka(x,t,params):
      N, P = x 
      alpha, beta, gamma, delta = params 
      derivs = [alpha*N - beta*N*P, gamma*N*P - delta*P] 
      return derivs
  
  N=2
  P=1
  alpha=3
  beta=0.5
  gamma=0.4
  delta=3
  
  params = [alpha, beta, gamma, delta]
  x0=[N,P]
  maxt = 20
  tstep = 0.01
  
  t=np.arange(0,maxt,tstep)
  equation=odeint(lotka, x0, t, args=(params,))
  
  plt.plot(t,equation)
  plt.xlabel("Time")
  plt.ylabel("Population size")
  plt.legend(["Prey", "Predator"], loc="upper right")
  
  plt.title('Prey &amp; Predator Static Model')
  plt.grid(color="b", alpha=0.5, linestyle="dashed", linewidth=0.5)
  </code></pre>
  
  <p>This is my code which produces a graph for fixed initial values of N and P. However, I'd like to change them to see how the plot changes. And for this, I'd like to use sliders like: <a href="http://matplotlib.org/users/screenshots.html#slider-demo" rel="nofollow noreferrer">http://matplotlib.org/users/screenshots.html#slider-demo</a> but I do not know how to add this into my code...</p>
  
  <p>Could anyone please give me any direction? Many thanks!! xx</p>