title: Is there a way to fit a normal curve to points?
body: <p>As a small project I've made a program the throws nd dice an nt number of times. At each throw it sums the results from the dice and adds it to a list. At the end the data is rappresented with matplot.</p>
  <pre><code>import random
  from collections import Counter
  import matplotlib.pyplot as plt
  
  nd = int(input(&quot;Insert number of dice: &quot;)) 
  nt = int(input(&quot;Insert number of throws: &quot;))
  print(nd, &quot; dice thrown &quot;, nt, &quot; times&quot;)
  print(&quot;Generating sums, please hold....&quot;)
  c = 0
  i = 0
  sum = 0
  sums = []
  while nt &gt;= i :
      while nd &gt;= c:
          g = random.randint(1, 6)
          sum = sum + g
          c += 1
      sums.append(sum)
      i = i+1
      c=0
      sum = 0
      print(&quot;Throw &quot;, i, &quot; of &quot;, nt)
  sums.sort()
  max = max(sums)
  min = min(sums)
  print(&quot;||Maximum result: &quot;, max, &quot; ||Minimum result: &quot;, min)
  
  print(&quot;Now ordering results&quot;)
  
  f = Counter(sums)
  y = list(f.values())
  x = list(f.keys())
  print(&quot;Rappresenting results&quot;)
  
  plt.plot(x, y)
  plt.xlabel(&quot;Risultati&quot;)
  plt.ylabel(&quot;Frequenza&quot;)
  plt.title(&quot;Distribuzione delle somme&quot;)
  plt.grid(True)
  plt.tight_layout()
  plt.show()
  </code></pre>
  <p>The resultant graph looks something like this:
  <a href="https://i.stack.imgur.com/CzWSx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CzWSx.png" alt="enter image description here" /></a></p>
  <p>I would like to know how to fit a gaussian curve to the points in order to make the graph clearer</p>