8000 Add image test for #26892 · matplotlib/matplotlib@3a4a86e · GitHub
[go: up one dir, main page]

Skip to content

Commit 3a4a86e

Browse files
SocobSimon May
authored andcommitted
Add image test for #26892
1 parent 4b853bc commit 3a4a86e

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

lib/matplotlib/tests/test_backend_pgf.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,3 +402,24 @@ def test_sketch_params():
402402
# \pgfdecoratecurrentpath must be after the path definition and before the
403403
# path is used (\pgfusepath)
404404
assert baseline in buf
405+
406+
407+
# test to make sure that the document font size is set consistently (see #26892)
408+
@needs_pgf_xelatex
409+
@pytest.mark.skipif(
410+
not _has_tex_package('unicode-math'), reason='needs unicode-math.sty'
411+
)
412+
@pytest.mark.backend('pgf')
413+
@image_comparison(['pgf_document_font_size.pdf'], style='default', remove_text=True)
414+
def test_document_font_size():
415+
mpl.rcParams.update({
416+
'pgf.texsystem': 'xelatex',
417+
'pgf.rcfonts': False,
418+
'pgf.preamble': r'\usepackage{unicode-math}',
419+
})
420+
plt.figure()
421+
plt.plot([], label=r'$this is a very very very long math label a \times b '
422+
r'+ 10^{-3}$ and some text')
423+
plt.plot([], label=r'\normalsize the document font size is '
424+
r'\the\fontdimen6\font')
425+
plt.legend()

0 commit comments

Comments
 (0)
0