Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6750915

Browse files
committed
Test for usetex
This passes on the current master as well as this branch. For whatever reason, the svg backend has trouble rendering the test case.
1 parent b0072a5 commit 6750915

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed
Binary file not shown.

lib/matplotlib/tests/test_usetex.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from __future__ import (absolute_import, division, print_function,
2+
unicode_literals)
3+
4+
from matplotlib.externals import six
5+
6+
import io
7+
8+
import numpy as np
9+
import matplotlib
10+
from matplotlib.testing.decorators import image_comparison, knownfailureif, cleanup
11+
import matplotlib.pyplot as plt
12+
13+
14+
@image_comparison(baseline_images=['test_usetex'], extensions=['pdf', 'png'])
15+
def test_usetex():
16+
matplotlib.rcParams['text.usetex'] = True
17+
fig = plt.figure()
18+
ax = fig.add_subplot(111)
19+
ax.text(0.1, 0.2,
20+
# the \LaTeX macro exercises character sizing and placement,
21+
# \left[ ... \right\} draw some variable-height characters,
22+
# \sqrt and \frac draw horizontal rules, \mathrm changes the font
23+
r'\LaTeX\ $\left[\int\limits_e^{2e}'
24+
r'\sqrt\frac{\log^3 x}{x}\,\mathrm{d}x \right\}',
25+
fontsize=24)
26+
ax.set_xticks([])
27+
ax.set_yticks([])

0 commit comments

Comments
 (0)