-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
[Bug]: Large file size when using fill_between() #22803
Copy link
Copy link
Open
Labels
Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issueshttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesGood first issueOpen a pull request against these issues if there are no active ones!Open a pull request against these issues if there are no active ones!
Milestone
Description
Metadata
Metadata
Assignees
Labels
Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issueshttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesGood first issueOpen a pull request against these issues if there are no active ones!Open a pull request against these issues if there are no active ones!
Type
Fields
Give feedbackNo fields configured for issues without a type.
Bug summary
Hi,
I am trying to save a plot to PDF (or SVG) that uses the fill_between function between two time series, and the resulting file is much larger than when plotting each series individually.
Code for reproduction
Actual outcome
Expected outcome
The file size of the file drawn with
fill_between()should stay roughly the same as the file drawing the min and the max only.Additional information
I have plotted the resulting file sizes for different numbers of data points.

The file size of the file generated with
fill_between()grows linearly with the number of data points (as could be expected), but not the file size of the file plotting the min and the max directly: maybe there's an optimization inplot()that's not being used infill_between()?Operating system
macOS
Matplotlib Version
3.4.3
Matplotlib Backend
module://matplotlib_inline.backend_inline
Python version
Python 3.9.7
Jupyter version
No response
Installation
pip