Skip to content

Commit 135e3c1

Browse files
committed
Add angle bracket image test
1 parent 90e4015 commit 135e3c1

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

6.31 KB
Loading

lib/matplotlib/tests/test_mathtext.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,3 +555,17 @@ def test_mathtext_operators():
555555
def test_boldsymbol(fig_test, fig_ref):
556556
fig_test.text(0.1, 0.2, r"$\boldsymbol{\mathrm{abc0123\alpha}}$")
557557
fig_ref.text(0.1, 0.2, r"$\mathrm{abc0123\alpha}$")
558+
559+
560+
@image_comparison(baseline_images=['math_angle_brackets.png'])
561+
def test_math_angle_brackets():
562+
fig = plt.figure(figsize=(5, 1))
563+
tests = [
564+
r'$\left< x \right>$',
565+
r'$\left< ? \right>$',
566+
r'$\left\langle \frac{1}{2}\right\rangle$',
567+
r'$\left\langle \frac{\sum_{0}^{1}}{2}\right\rangle$',
568+
r'$\left<\frac{\sum_{0}^{1}}{\sum_{0}^{1}}\right>$'
569+
]
570+
for idx, text in enumerate(tests):
571+
fig.text((idx + 0.3)/len(tests), 0.5, text, math_fontfamily='cm')

0 commit comments

Comments
 (0)