title: matplotlib, including more than one defined variable on legend label
body: <p>Im trying to include two or more variables, previously defined in the code, to the label for the legend or when plotting text. For example, I have a bunch of functions plotted and I want the equations for each on the legend. If I just have something like y = Ax, where A is found by fitting a function to some data I would write something like:</p>
  
  <pre><code> plt.plot(x, y, label='y = %.2f x' %A) 
  </code></pre>
  
  <p>and on the legend I would see the real value of A on the equation. Now if I want to do the same with y = Ax + B and I go</p>
  
  <pre><code> plt.plot(x, y, label='y = %.2f x + %.2f' %A %B)
  </code></pre>
  
  <p>I get an error. Most of the ways I tried gave me syntax error and I got one that said not enough arguments for format string.</p>