diff --git a/lib/matplotlib/_mathtext.py b/lib/matplotlib/_mathtext.py index 5b4e8ed20db3..510f66dffd27 100644 --- a/lib/matplotlib/_mathtext.py +++ b/lib/matplotlib/_mathtext.py @@ -418,10 +418,10 @@ def _get_glyph(self, fontname, font_class, sym): ('ex', '\xbb'), ('ex', '\x26')], r'\rceil': [('ex', '\xa8'), ('ex', '\x6d'), ('ex', '\xbc'), ('ex', '\x27')], - r'\langle': [('ex', '\xad'), ('ex', '\x44'), - ('ex', '\xbf'), ('ex', '\x2a')], - r'\rangle': [('ex', '\xae'), ('ex', '\x45'), - ('ex', '\xc0'), ('ex', '\x2b')], + r'\langle': [('ex', '\xad'), ('ex', '\x2a'), + ('ex', '\xbf'), ('ex', '\x44')], + r'\rangle': [('ex', '\xae'), ('ex', '\x2b'), + ('ex', '\xc0'), ('ex', '\x45')], r'\__sqrt__': [('ex', '\x70'), ('ex', '\x71'), ('ex', '\x72'), ('ex', '\x73')], r'\backslash': [('ex', '\xb2'), ('ex', '\x2f'), @@ -432,8 +432,8 @@ def _get_glyph(self, fontname, font_class, sym): ('ex', '\x64')], r'\widetilde': [('rm', '\x7e'), ('ex', '\x65'), ('ex', '\x66'), ('ex', '\x67')], - r'<': [('cal', 'h'), ('ex', 'D')], - r'>': [('cal', 'i'), ('ex', 'E')] + r'<': [('ex', '\x44')], + r'>': [('ex', '\x45')] } for alias, target in [(r'\leftparen', '('), diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/math_angle_brackets.png b/lib/matplotlib/tests/baseline_images/test_mathtext/math_angle_brackets.png new file mode 100644 index 000000000000..b77f26d0f40b Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/math_angle_brackets.png differ diff --git a/lib/matplotlib/tests/test_mathtext.py b/lib/matplotlib/tests/test_mathtext.py index 5a9e8a8b9264..26775feb2f96 100644 --- a/lib/matplotlib/tests/test_mathtext.py +++ b/lib/matplotlib/tests/test_mathtext.py @@ -557,3 +557,17 @@ def test_mathtext_operators(): def test_boldsymbol(fig_test, fig_ref): fig_test.text(0.1, 0.2, r"$\boldsymbol{\mathrm{abc0123\alpha}}$") fig_ref.text(0.1, 0.2, r"$\mathrm{abc0123\alpha}$") + + +@image_comparison(baseline_images=['math_angle_brackets.png']) +def test_math_angle_brackets(): + fig = plt.figure(figsize=(5, 1)) + tests = [ + r'$\left< x \right>$', + r'$\left< ? \right>$', + r'$\left\langle \frac{1}{2}\right\rangle$', + r'$\left\langle \frac{\sum_{0}^{1}}{2}\right\rangle$', + r'$\left<\frac{\sum_{0}^{1}}{\sum_{0}^{1}}\right>$' + ] + for idx, text in enumerate(tests): + fig.text((idx + 0.3)/len(tests), 0.5, text, math_fontfamily='cm')