Update pgf baseline image for TeX Live 2025 by axel-j-larsson · Pull Request #32504 · matplotlib/matplotlib · GitHub
Skip to content

Update pgf baseline image for TeX Live 2025 - #32504

Open
axel-j-larsson wants to merge 1 commit into
matplotlib:mainfrom
axel-j-larsson:fix-pgf-test-baseline-image
Open

axel-j-larsson wants to merge 1 commit into
matplotlib:mainfrom
axel-j-larsson:fix-pgf-test-baseline-image

Conversation

@axel-j-larsson

Copy link
Copy Markdown

PR summary

Fixes issue #29790. Also relates to PR #32478 .
With TeX Live 2025, test_backend_pgf.py was failing due to pgf_rcupdate2, where a single character had changed location by a pixel:
pgf_rcupdate2_pdf-failed-diff

I investigated it and the PGF files generated by pgf_backend.py were identical between TeX Live versions. After manually regenerating the PDFs from the same PGF file with both TeX Live 2025 and 2024, I found that their contents differed slightly in regards to object positioning. After additionally manually rasterizing the output with ghostscript (as done in the test), the same one-pixel difference appeared in both the files created by Matplotlib and the ones generated and rasterized manually.

It appears that the difference is instead caused by updates in PDFTeX's rendering engine, and would as such not be anything directly caused by a bug in Matplotlib. As such, I determined the most suitable fix would be to update the baseline image. I have also checked the new baseline with TeX Live 2026, and it still passes there.

However, the new baseline does instead fail for TeX Live 2024 (and presumably earlier versions as well). As such, the suitability of this PR depends on what which TeX Live version to support, and in extension which Ubuntu version to support (see #32478).

AI Disclosure

AI was used to help investigate the image difference and generate new PDFs directly with pdfLaTeX. However, the new baseline test results have been verified and reviewed manually.

PR quality check

  • Use an expressive title, e.g. "Fix title font property precedence"
  • New and changed code is tested
  • N/A Plotting related features are demonstrated in an example
  • N/A New features and API changes have release notes
  • N/A Documentation complies with general and docstring guidelines

@github-actions

Copy link
Copy Markdown

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants