1 | initial version |

matplotlib uses its own typsetting system called mathtext by default. I think the problem you are getting is due to mathtext not supporting arrays in math mode?

In any case, you can work around this by telling matplotlib to use your system LaTeX instead of mathtext like this:

```
from matplotlib import rc
rc('text', usetex=True)
my_matrix = r'$\left( \begin{array}{ll} 2 & 3 \\ 4 & 5 \end{array} \right)$'
text(my_matrix, (1,1))
```

You can look at another example here, it shows you how to change fonts to match the font in your document.

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.