[Bug]: pgf_rcupdate1 in test_backend_pgf.py::test_rcupdate fails for TeX Live 2026 · Issue #32505 · matplotlib/matplotlib · GitHub
Skip to content

[Bug]: pgf_rcupdate1 in test_backend_pgf.py::test_rcupdate fails for TeX Live 2026 #32505

Open

Description

@axel-j-larsson

Bug summary

When working on #32504 I tested the new baseline against TeX Live 2024, 2025, and 2026. When running the tests with TeX Live 2026 pgf_rcupdate1 failed.

Code for reproduction

__________________________________________________________________________________________ test_rcupdate __________________________________________________________________________________________

    @needs_pgf_xelatex
    @needs_pgf_pdflatex
    @mpl.style.context('default')
    @pytest.mark.backend('pgf')
    def test_rcupdate():
        rc_sets = [{'font.family': 'sans-serif',
                    'font.size': 30,
                    'figure.subplot.left': .2,
                    'lines.markersize': 10,
                    'pgf.rcfonts': False,
                    'pgf.texsystem': 'xelatex'},
                   {'font.family': 'monospace',
                    'font.size': 10,
                    'figure.subplot.left': .1,
                    'hatch.color': 'orange',
                    'hatch.linewidth': 2,
                    'lines.markersize': 20,
                    'pgf.rcfonts': False,
                    'pgf.texsystem': 'pdflatex',
                    'pgf.preamble': ('\\usepackage[utf8x]{inputenc}'
                                     '\\usepackage[T1]{fontenc}'
                                     '\\usepackage{sfmath}')}]
        tol = [0, 13.2] if _old_gs_version else [0, 0]
        for i, rc_set in enumerate(rc_sets):
            with mpl.rc_context(rc_set):
                for substring, pkg in [('sfmath', 'sfmath'), ('utf8x', 'ucs')]:
                    if (substring in mpl.rcParams['pgf.preamble']
                            and not _has_tex_package(pkg)):
                        pytest.skip(f'needs {pkg}.sty')
                create_figure()
>               compare_figure(f'pgf_rcupdate{i + 1}.pdf', tol=tol[i])

lib/matplotlib/tests/test_backend_pgf.py:167: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

fname = 'pgf_rcupdate1.pdf', savefig_kwargs = {}, tol = 0

    def compare_figure(fname, savefig_kwargs={}, tol=0):
        actual = os.path.join(result_dir, fname)
        plt.savefig(actual, **savefig_kwargs)
    
        expected = os.path.join(result_dir, "expected_%s" % fname)
        shutil.copyfile(os.path.join(baseline_dir, fname), expected)
        err = compare_images(expected, actual, tol=tol)
        if err:
>           raise ImageComparisonFailure(err)
E           matplotlib.testing.exceptions.ImageComparisonFailure: Error: Image files did not match.
E             RMS Value: 1.0027234615164846
E             Expected:  
E               /home/axelj/Documents/matplotlib/matplotlib/result_images/test_backend_pgf/expected_pgf_rcupdate1_pdf.png
E             Actual:    
E               /home/axelj/Documents/matplotlib/matplotlib/result_images/test_backend_pgf/pgf_rcupdate1_pdf.png
E             Difference:
E               /home/axelj/Documents/matplotlib/matplotlib/result_images/test_backend_pgf/pgf_rcupdate1_pdf-failed-diff.png
E             Tolerance: 
E               0

lib/matplotlib/tests/test_backend_pgf.py:37: ImageComparisonFailure

Actual outcome

pgf_rcupdate1_pdf.png pgf_rcupdate1_pdf-failed-diff.png

Expected outcome

expected_pgf_rcupdate1_pdf.png

Additional information

This bug is similar to #29790 and perhaps again relates to rendering differences that have been introduced in TeX Live 2026.

Operating system

Ubuntu

Matplotlib Version

3.12.0

Matplotlib Backend

No response

Python version

3.12.14

Jupyter version

No response

Installation

None

Activity

  1. iccir commented on Oct 19, 2026

    @iccir
    Contributor

    Here's the diff overlayed on the actual output:

    Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions