title: How to do a simple Gaussian mixture sampling and PDF plotting with NumPy/SciPy?
body: <p>I add three normal distributions to obtain a new distribution as shown below, how can I do sampling according to this distribution in python?</p>
  
  <pre><code>import matplotlib.pyplot as plt
  import scipy.stats as ss
  import numpy as np
  
  
  x = np.linspace(0, 10, 1000)
  y1 = [ss.norm.pdf(v, loc=5, scale=1) for v in x]
  y2 = [ss.norm.pdf(v, loc=1, scale=1.3) for v in x]
  y3 = [ss.norm.pdf(v, loc=9, scale=1.3) for v in x]
  y = np.sum([y1, y2, y3], axis=0)/3
  
  plt.plot(x, y, '-')
  plt.xlabel('$x$')
  plt.ylabel('$P(x)$')
  </code></pre>
  
  <p>BTW, is there a better way to plot such a probability distribution?</p>