matplotlib/matplotlib — Issue #715: mathtext \left and \right delimiters not working
Author: MOBle
Created: 2012-02-24 20:16:41+00:00
State: open

Mathtext doesn't seem to understand all delimiters when using \left and \right. For example, I can do

import matplotlib.pyplot as plt
plt.plot([0,1,4,9])
plt.ylabel(r'$\left\{ \frac{a}{b} \right\}$')
plt.show()

The result is a big ugly traceback ending in

matplotlib.pyparsing.ParseFatalException: Expected a delimiter
$\left\{ \frac{a}{b} \right\}$ (at char 0), (line:1, col:1)

Using \left{ does work (but that's incorrect TeX), while \left[ doesn't work either. When I set

matplotlib.rcParams['text.usetex'] = True

Everything works as expected. But I'd prefer to be able to use mathtext.

I am using matplotlib version 1.1.0 with python 2.7.2 on Mac OS X 10.6.8. I tried this on a new user account with no matplotlibrc or pythonrc. My default backend is MacOSX, but I get the same thing with Agg.