Repository navigation
Closed
Conversation
added 20 commits
November 15, 2025 16:45
…e keeping PDF the same
…e keeping PDF the same
…SVG while keeping PDF the same" This reverts commit ab81ebf.
…/cinocefalia/matplotlib into fix/svg-pdf-simplify-fillbetween
…/cinocefalia/matplotlib into fix/svg-pdf-simplify-fillbetween
…/cinocefalia/matplotlib into fix/svg-pdf-simplify-fillbetween
Fixes #22803. - Simplify path handling in PDF/SVG backends - Reduce output size for fill_between - Add regression test
ghost
deleted the
simplify_fb
branch
March 23, 2026 18:42
Author
|
Closing in favor of a cleaned PR branch with only the intended commits/files. |
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR summary
Suggestion for closing #22803
This PR improves
fill_between()output size in the PDF and SVG backends when path simplification is enabled.Why
plot()already benefits from path simplification becauseLine2Dpaths are passed to the backends with the relevant simplification behavior already in place. In contrast,fill_between()produces aFillBetweenPolyCollection, and the resulting collection paths were not consistently reaching the vector backends in a form that allowed the same simplification to happen.In practice, this meant that increasing
path.simplify_thresholdgreatly reduced vector output size for line plots, but often had little or no effect forfill_between().What does this PR change
FillBetweenPolyCollectionmarks its generated paths as simplifiable.should_simplify=True.Results
In the large-data case discussed in #22803,
fill_between()PDF/SVG output size is reduced by ~98–99% when simplification is enabled, bringing it in line with the reductions already seen for line plots.Testing
Regression test has been added in
lib/matplotlib/tests/test_fill_between_simplify.py.AI was used to assist with debugging environment issues and refining the PR description, all the rest being manually tested.
More detailed info on this approach can be found here: #22803 (comment)