latex-markdown labels on matplotlib
<p>I have a <code>matplotlib</code> chart which I want to annotate with latex markdown. </p>

<pre><code>axs.annotate(s='$r_f = {:.2f}$'.format(r), xy=[2005, 7],
             xycoords="data", fontsize=18)
</code></pre>

<p>this works fine, but I want the latex code with more than one letter in the subscript.
I need instead <code>$r_{fit}$</code>, but that confuses the internal system of python's format method.</p>

<pre><code>c:\Users\Dean\Dropbox\Dean\Study\_Thesis\2. Paper\code\paper\charts.py in plot_prediction(x, y, data, future_x, future_y, future_data, death)
    141         axs.scatter(x, data, label='Train Data', color=_palette[0])
    142         r, p = pearsonr(y, data)
--&gt; 143         axs.annotate(s=r'$r_{fit} = {:.2f}$'.format(r), xy=[2005, 7],
    144                      xycoords="data", fontsize=18)
    145         # print p

KeyError: 'fit'
</code></pre>

<p>I tried many oprions with the escape characters but nothing worked.</p>