Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Labels
Milestone
Description
Bug report
Bug summary
inset_locator.mark_inset()
sometimes misplaces the box connector lines if x/y limits on the parentAxes
have not been explicitly set. Updating the plot (e.g. by saving the figure) seems to fix it.
Code for reproduction
importmatplotlib.pyplotaspltimportmpl_toolkits.axes_grid1.inset_locatorasmilocfig, (inset,full)=plt.subplots(ncols=2)# swapping the axes makes the example work# full, inset = inset, fullfull.plot([-1,0], [-1,0])inset.set_xlim(-0.6,-0.4)inset.set_ylim(-0.6,-0.4)# workaround# full.set_xlim(-1.0, 0.0)# full.set_ylim(-1.0, 0.0)miloc.mark_inset(full,inset,1,4)fig.savefig('Bug.png')# saving the figure a second time produces the expected resultfig.savefig('NoBug.png')
Actual outcome
Expected outcome
This issue was not present in version 3.0.2.
Matplotlib version
- Operating system: Fedora and Debian
- Matplotlib version: 3.2.1 and 3.2.2
- Matplotlib backend (
print(matplotlib.get_backend())
):Qt5Agg
andagg
- Python version: 3.8
- Jupyter version (if applicable): N/A
- Other libraries: N/A
Installed via pip on Debian and both pip and dnf on Fedora.