GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Update pgf baseline image for TeX Live 2025 by axel-j-larsson · Pull Request #32504 · matplotlib/matplotlib

Conversation

@axel-j-larsson

@axel-j-larsson axel-j-larsson commented Oct 19, 2026

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-actions

github-actions Bot commented Oct 19, 2026

Copy link
Copy Markdown

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks. We also ask that you please finish addressing any review comments on this PR and wait for it to be merged (or closed) before opening a new one, as it can be a valuable learning experience to go through the review process.

You can also join us on discourse chat for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide.
Please let us know if (and how) you use AI, it will help us give you better feedback on your PR.

We strive to be a welcoming and open project. Please follow our Code of Conduct.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the first-contribution label Oct 19, 2026
@axel-j-larsson axel-j-larsson mentioned this pull request Oct 19, 2026
[Bug]: pgf_rcupdate1 in test_backend_pgf.py::test_rcupdate fails for TeX Live 2026 #32505
Open
@iccir iccir added the backend: pgf label Oct 19, 2026
@axel-j-larsson

axel-j-larsson commented Oct 27, 2026

Copy link
Copy Markdown
Author

Hi @iccir, just checking back to see if there were any plans on changing the CI to use TeX Live 2025. If not, would it perhaps be a good idea to instead specify which version of it that is expected in the docs?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@iccir

iccir commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

I'm honestly not sure, as this isn't my area of expertise. My instinct would be to pick the TeX Live version with the most users and then xfail the tests on other configurations. Ultimately, all tests either need to pass or be expected to fail.

axel-j-larsson reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@axel-j-larsson
Make pgf_rcupdate2 xfail for newer pdftex versions
180b65c
@axel-j-larsson
axel-j-larsson force-pushed the fix-pgf-test-baseline-image branch from 1359e47 to 180b65c Compare November 4, 2026 17:51
@github-actions github-actions Bot removed the backend: pgf label Nov 4, 2026
iccir
iccir reviewed Nov 4, 2026
View reviewed changes
Comment thread lib/matplotlib/tests/test_backend_pgf.py Outdated
'\\usepackage{sfmath}')}]
tol = [0, 13.2] if _old_gs_version else [0, 0]
for i, rc_set in enumerate(rc_sets):
if i == 1 and mpl._get_executable_info('pdflatex').version > Version('1.40.26'):

@iccir iccir Nov 4, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be parse_version to match existing code.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

axel-j-larsson reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@iccir iccir Nov 4, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally, can mpl._get_executable_info('pdflatex') return None for info?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@axel-j-larsson axel-j-larsson Nov 4, 2026

Copy link
Copy Markdown
Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell, pdflatex has used the same versioning format since mid 2005, so as long as a version that isn't older than that is used it shouldn't return None.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread lib/matplotlib/__init__.py Outdated
f"version supported by Matplotlib is 3.0")
return info
elif name == "pdflatex":
return impl(["pdflatex", "-v"], r"pdfTeX .*-(\d+\.\d+\.\d+)")

@iccir iccir Nov 4, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any danger of -v failing on old pdflatex? See other review comment about returning None.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@axel-j-larsson axel-j-larsson Nov 4, 2026

Copy link
Copy Markdown
Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using -version instead might be better, as I believe it has been supported for longer.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@axel-j-larsson
Update -version option & use parse_version
dd0ed5b
@axel-j-larsson
axel-j-larsson requested a review from iccir November 5, 2026 21:43
@axel-j-larsson

axel-j-larsson commented Nov 5, 2026

Copy link
Copy Markdown
Author

I did some revisions based on your feedback. Although the codecov check is failing (and for some reason I cannot access the line-by-line analysis of it either) and I am unsure whether something needs to be done in regards to that (and if so what).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@axel-j-larsson

axel-j-larsson commented Nov 11, 2026

Copy link
Copy Markdown
Author

Hi again @iccir, just checking back in case you missed my previous update. Thanks

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

iccir
iccir reviewed Nov 11, 2026
View reviewed changes
Comment thread lib/matplotlib/tests/test_backend_pgf.py
for i, rc_set in enumerate(rc_sets):
if (i == 1 and
mpl._get_executable_info('pdflatex').version > parse_version('1.40.26')):
pytest.xfail(reason="This test currently requires a pdfTeX "

@iccir iccir Nov 11, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking i == 1 seems fragile. Could we check the value of pgf.texsystem instead?

I'm a bit confused, however - why are we checking for 1.40.26 or earlier and not requiring a newer version of TeX Live? If TeX Live 2025 is more widely used, I think that we should have tests / images that pass on it and then xfail on older versions.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

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

Reviewers

@iccir iccir iccir left review comments

At least 1 approving review is required to merge this pull request.

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

first-contribution

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@axel-j-larsson @iccir
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.