Closed
Description
Bug summary
When adding indicate_inset
on constrained figures, the position of Axes changes from a figure without indicators. This can be worked around by manually setting the connectors out of layout.
Code for reproduction
import matplotlib.pyplot as plt
for i in range(2):
fig, axs = plt.subplots(2, 1, constrained_layout=True)
for ax in axs:
ax.plot([1, 2, 3])
axs[1].set_xlim(0.5, 1.5)
# Add inset indicators only on the second figure.
_, conns = axs[0].indicate_inset_zoom(axs[1])
plt.show()
Actual outcome
Without connectors:
With connectors:
There is now some extra space between the two vertically.
Expected outcome
If you add:
for con in conns:
con.set_in_layout(False)
then the Axes as positioned the same as the original image:
Additional information
No response
Operating system
No response
Matplotlib Version
Matplotlib Backend
No response
Python version
No response
Jupyter version
No response
Installation
git checkout
Metadata
Metadata
Assignees
Labels
No labels