MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_usetex

Function test_usetex

lib/matplotlib/tests/test_usetex.py:23–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21 extensions=['pdf', 'png'],
22 style="mpl20")
23def test_usetex():
24 mpl.rcParams['text.usetex'] = True
25 fig, ax = plt.subplots()
26 kwargs = {"verticalalignment": "baseline", "size": 24,
27 "bbox": dict(pad=0, edgecolor="k", facecolor="none")}
28 ax.text(0.2, 0.7,
29 # the \LaTeX macro exercises character sizing and placement,
30 # \left[ ... \right\} draw some variable-height characters,
31 # \sqrt and \frac draw horizontal rules, \mathrm changes the font
32 r'\LaTeX\ $\left[\int\limits_e^{2e}'
33 r'\sqrt\frac{\log^3 x}{x}\,\mathrm{d}x \right\}$',
34 **kwargs)
35 ax.text(0.2, 0.3, "lg", **kwargs)
36 ax.text(0.4, 0.3, r"$\frac{1}{2}\pi$", **kwargs)
37 ax.text(0.6, 0.3, "$p^{3^A}$", **kwargs)
38 ax.text(0.8, 0.3, "$p_{3_2}$", **kwargs)
39 for x in {t.get_position()[0] for t in ax.texts}:
40 ax.axvline(x)
41 for y in {t.get_position()[1] for t in ax.texts}:
42 ax.axhline(y)
43 ax.set_axis_off()
44
45
46@check_figures_equal(extensions=['png', 'pdf', 'svg'])

Callers

nothing calls this directly

Calls 6

axvlineMethod · 0.80
axhlineMethod · 0.80
subplotsMethod · 0.45
textMethod · 0.45
get_positionMethod · 0.45
set_axis_offMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…