tex

Python: Unable to Render Tex in Matplotlib

半腔热情 提交于 2019-11-27 04:28:48
I recently upgraded my laptop to Snow Leopard, updated TeX to Version 3.1415926 (TeX Live 2011/MacPorts 2011_5), and installed Python 2.7.3. After all these installs, I ran macport selfupdate and macport upgrade outdated. However, now when I try to use TeX in matplotlib, I receive the following: LaTeX was not able to process the following string:'lp' Here is the full report generated by LaTeX: This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011/MacPorts 2011_5) restricted \write18 enabled. entering extended mode (./64a53cc27244d5ee10969789771e33fa.tex LaTeX2e <2009/09/24> Babel <v3.8l

use format with tex fraction expression in matplotlib python

核能气质少年 提交于 2019-11-26 11:44:59
问题 I use matplotlib. I need to get xlabels like: [1/8,2/8,3/8,4/8..14/8]. I want to make it in a loop. Therefore, for better view I use TEX in Python. For rendering the fraction expression in the loop I use .format method. But it doesn\'t work properly. There is some conflict between using of {} in TEX and .format method. I tried to use double {} but it as well doesn\'t work. import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) xax = ax.xaxis # get x axis labels = [\'0\']