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
Description
Bug summary
pyplot.Figure.add_axes
does not seem to respect the transform argument.
Edit: This might already exist for a while:#8986
Code for reproduction
frommatplotlibimportpyplotaspltfig,axs=plt.subplots(nrows=2,sharex=True )# left, bottom, width, heightfig.add_axes([.5,.5,.1,.1],transform=axs[1].transAxes)fig.tight_layout()
Actual outcome
Expected outcome
I found this workaround in the above-mentioned issue.
importmatplotlibbox=matplotlib.transforms.Bbox.from_bounds(.5,.5,.1,.1)fig.add_axes(fig.transFigure.inverted().transform_bbox(axs[1].transAxes.transform_bbox(box)))
Additional information
No response
Operating system
Arch
Matplotlib Version
3.6.1
Matplotlib Backend
module://matplotlib_inline.backend_inline
Python version
Python 3.10.7
Jupyter version
Jupyter Lab v. 3.4.5
Installation
pip