title: python: how to plot a function for a random set of values for a variable
body: <p>I'm trying to figure out how to plot a function that is dependent on a variable <code>k</code> but the values of this variable are a random selection of numbers: <code>1.9, 2.9, 4.3, 8.2</code>. I thought about using <code>range</code> but the values for <code>k</code> aren't evenly spread out - is there a way of plotting each of these on the same plot without having to rewrite my function under a letter for each value (i.e. iterate the function over the 4 values listed above)? The code I have is below:</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  
  k = 1.9
  w0 = -0.8
  
  a = np.linspace(0,1,1000)
  
  w = -1.0 + (1.0 + w0)*(a**(3.0*k - 3.0))
  
  plt.plot(a,w,'k--')
  plt.axis([0,1,-1.2,-0.2])
  plt.grid(True)
  plt.show()
  </code></pre>
  
  <p>Any help is appreciated.</p>