I'm rather new at using python and especially numpy, and matplotlib. Running the code below (which works fine without the \frac{}{}
part) yields the error:
Normalized Distance in Chamber ($
rac{x}{L}$)
^
Expected end of text (at char 32), (line:1, col:33)
The math mode seems to work fine for everything else I've tried (symbols mostly, e.g. $\mu$
works fine and displays µ) so I'm not sure what is happening here. I've looked up other peoples code for examples and they just seem to use \frac{}{}
with nothing special and it works fine. I don't know what I'm doing differently. Here is the code. Thanks for the help!
import numpy as np
import math
import matplotlib.pylab as plt
[ ... bunch of calculations ... ]
plt.plot(xspace[:]/L,vals[:,60])
plt.axis([0,1,0,1])
plt.xlabel('Normalized Distance in Chamber ($\frac{x}{L}$)')
plt.savefig('test.eps')
Also, I did look up \f and it seems its an "escape character", but I don't know what that means or why it would be active within TeX mode.