In continuation of the following question:
\text does not work in a matplotlib label and RuntimeError: Failed to process string with tex because latex could not be found
from matplotlib import pyplot as plt
import matplotlib as mpl
mpl.rcParams['text.usetex'] = True
mpl.rcParams['text.latex.preamble'] = [r'\usepackage{amsmath}'] #for \text command
plt.plot([1,2,3])
plt.xlabel(r"$\frac{\text{Actual Value of Production}}{Demand}$", fontsize=16)
plt.show()
I got the following error:
RuntimeError: Failed to process string with tex because latex could not be found
Which means that the latex should be installed locally.
(Is there any other work around?)
In matplotlib "manual" says, that the following packages needed:
- LaTeX
- dvipng
- Ghostscript
Is there more simple work around to use a \text
command in Latex ?
If not what is the most easies way to install above in OSX ?