title: How to insert a variable into a text method of matplotlib
body: <p>The following code represents two different functions, sigmoid(x), and logit(x).
  How it is possible to insert the dynamic labels, <strong>a and b</strong> into the <code>plt.text()</code> which derived from matplotlib.pyplot?</p>
  
  <pre><code>import math
  import matplotlib.pyplot as plt
  
  plt.ylabel("F(x)")
  plt.xlabel("x")
  
  a = 6
  b = 0.9985
  
  def sigmoid(x):
      return 1/(1+math.exp(-x))
  
  #LOU jit
  def logit (x):
      return math.log(x/(1-x))
  
  
  
  z = sigmoid(a)
  l = logit(b)
  
  print(z)
  print(l)
  
  font = {
          'family': 'serif',
          'color' : 'green',
          'weight': 'normal',
          'size'  :  9
  }
  plt.plot([a,z],[b,l],'ro')
  plt.text(a,z,'Sigmoid(a)',fontdict=font)
  plt.text(b,l,'Logit(b)',fontdict=font)
  plt.axis([0,10,0,50])
  
  plt.grid(True)
  
  plt.show()
  </code></pre>