.. _pylab_examples-mathtext_examples: pylab_examples example code: mathtext_examples.py ================================================= .. plot:: /home/mdboom/Work/builds/matplotlib/doc/mpl_examples/pylab_examples/mathtext_examples.py :: #!/usr/bin/env python from __future__ import print_function import os, sys, re import gc stests = [ r'$a+b+\dots+\dot{s}+\ldots$', r'$x \doteq y$', r'\$100.00 $\alpha \_$', r'$\frac{\$100.00}{y}$', r'$x y$', r'$x+y\ x=y\ x 0xffff: # stests.append(ur'$\mathrm{\ue0f2 \U0001D538}$') from pylab import * def doall(): tests = stests figure(figsize=(8, (len(tests) * 1) + 2)) plot([0, 0], 'r') grid(False) axis([0, 3, -len(tests), 0]) yticks(arange(len(tests)) * -1) for i, s in enumerate(tests): print (i, s) text(0.1, -i, s, fontsize=20) #savefig('mathtext_examples') #close('all') show() if '--latex' in sys.argv: fd = open("mathtext_examples.ltx", "w") fd.write("\\documentclass{article}\n") fd.write("\\begin{document}\n") fd.write("\\begin{enumerate}\n") for i, s in enumerate(stests): s = re.sub(r"(?