Skip to content

Commit 7371e42

Browse files
committed
add check_figures test
1 parent e441f2b commit 7371e42

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

doc/users/next_whats_new/boldsym_mathtext.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ To change font to bold and italic enclose the text in a font command as
77
shown:
88

99
.. code-block::
10-
r'$\boldsymbol{a+2+\alpha}$
10+
11+
r'$\boldsymbol{a+2+\alpha}$'
12+
1113
.. math::
1214
\boldsymbol{a+2+\alpha}

lib/matplotlib/tests/test_mathtext.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@
134134
r'$\sum x\quad\sum^nx\quad\sum_nx\quad\sum_n^nx\quad\prod x\quad\prod^nx\quad\prod_nx\quad\prod_n^nx$', # GitHub issue 18085
135135
r'$1.$ $2.$ $19680801.$ $a.$ $b.$ $mpl.$',
136136
r'$\text{text}_{\text{sub}}^{\text{sup}} + \text{\$foo\$} + \frac{\text{num}}{\mathbf{\text{den}}}\text{with space, curly brackets \{\}, and dash -}$',
137-
138137
r'$\boldsymbol{boldsymbol} \boldsymbol{\alpha} \boldsymbol{01234} \boldsymbol{\alpha * \beta}$',
139138
]
140139

@@ -511,3 +510,12 @@ def test_mathtext_cmr10_minus_sign():
511510
ax.plot(range(-1, 1), range(-1, 1))
512511
# draw to make sure we have no warnings
513512
fig.canvas.draw()
513+
514+
515+
@check_figures_equal(extensions=["png"])
516+
def test_boldsymbol(fig_test, fig_ref):
517+
fig_test.text(0.1, 0.1, r"$\boldsymbol{abc0123\alpha}")
518+
fig_test.text(0.1, 0.2, r"$\boldsymbol{\mathrm{abc0123\alpha}}")
519+
520+
fig_ref.text(0.1, 0.1, r"$\boldsymbol{abc0123\alpha}")
521+
fig_ref.text(0.1, 0.2, r"$\boldsymbol{\mathrm{abc0123\alpha}}")

0 commit comments

Comments
 (0)