title: Probability Distribution Plot
body: <p>I am reading a .dat file for this and I am trying to plot a Gaussian probability distribution. It used to plot before (though not what I wanted) but when I run it in VS it won't plot anymore. Help please!</p>
  <pre><code>    #!/usr/bin/env python
  
  import matplotlib
  import numpy as np
  from matplotlib.backends.backend_pdf import PdfPages
  import matplotlib.pyplot as plt
  
  data = np.loadtxt('positionVSMeanSquareOutput.dat')
  dataProb = np.loadtxt('positionVSProbabilityOutput2.dat')
  
  time = data[:, 0] + 1
  MSDth = time            #&lt;x^2&gt; analytical
  MSDnum = data[:, 1]     #&lt;x^2&gt; numerical / computer simulated
  MSDerr = data[:, 3]     #error bar of &lt;x^2&gt;
  
  Fsq1 = data[:, 4]       #F_s(q1,x(t))
  Fsq1num = data[:, 10]       #F_s(q1,x(t)) numerical
  Fsq1err = data[:, 7]    #error bar of F_s(q1,x(t))
  
  Fsq2 = data[:, 5]       #F_s(q2,x(t))
  Fsq2num = data[:, 11]       #F_s(q1,x(t)) numerical
  Fsq2err = data[:, 8]    #error bar of F_s(q2,x(t))
  
  Fsq3 = data[:, 6]       #F_s(q3,x(t))
  Fsq3num = data[:, 12]       #F_s(q1,x(t)) numerical
  Fsq3err = data[:, 9]    #error bar of F_s(q2,x(t))
  
  xAxis = dataProb[:,0]   #Probability
  yAxis = dataProb[:,1]
  binomDist = dataProb[:,2]
  
  with PdfPages('positionVSMeanSquareOutput.pdf') as pdf:
  # ======== PROBABILITY ==============   
  # TASK: To create a better plot for the distribution
  
      fig=plt.figure()
      ax.scatter(xAxis, yAxis, color='r') 
      ax.scatter(xAxis, binomDist, color='b')
  
      plt.legend(loc=4)
      #plt.show()
      pdf.savefig()
      plt.close()
  </code></pre>