Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Open
Labels
Description
Bug summary
In matplotlib 3.10.0, usingfill_between()
withtransform=ax.get_xaxis_transform()
increases the y-limits every time it is called, and the original plot gets squeezed gradually, which did not happen in previous version (3.8.0).
Code for reproduction
#Modified from https://matplotlib.org/stable/gallery/lines_bars_and_markers/fill_between_demo.htmlimportmatplotlib.pyplotaspltimportnumpyasnpfig,ax=plt.subplots()x=np.arange(0,4*np.pi,0.01)y=np.sin(x)ax.plot(x,y,color='black')threshold=0.75ax.axhline(threshold,color='green',lw=2,alpha=0.7)foriinrange(10):ax.fill_between(x+0.5*i,0,1,where=y>threshold,color='green',alpha=0.1,transform=ax.get_xaxis_transform())
Actual outcome

Expected outcome

Additional information
The expected outcome is from version 3.8.0
Operating system
Window 11
Matplotlib Version
3.10.0
Matplotlib Backend
module://matplotlib_inline.backend_inline
Python version
Python 3.12.11
Jupyter version
7.4.4
Installation
None