Thanks to visit codestin.com
Credit goes to github.com

Skip to content

zoomed_inset_axes places the inset box outside the figure when the axes are inverted #8589

Closed
@jieunchoi

Description

@jieunchoi

Bug report

Bug summary

Now when using mpl_toolkits.axes_grid1.inset_locator.zoomed_inset_axis with an inverted axis, the inset box gets placed outside the figure. This was not an issue in the past.

Code for reproduction

This is okay (image B):

from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes, mark_inset
fig = plt.figure()
ax = plt.subplot(111)
ax.plot([1,2,3], [1,2,3])
ax.axis([1,3,1,3])
inset_ax = zoomed_inset_axes(ax, zoom=2.5, loc=4)
inset_ax.axis([1.1, 1.4, 1.1, 1.4])

but this is not (image A):

from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes, mark_inset
fig = plt.figure()
ax = plt.subplot(111)
ax.plot([1,2,3], [1,2,3])
ax.axis([3,1,3,1])
inset_ax = zoomed_inset_axes(ax, zoom=2.5, loc=4)
inset_ax.axis([1.4, 1.1, 1.4, 1.1])

Actual outcome
image A
image

Expected outcome
image B
image

Matplotlib version

  • Operating System: Mac OS 10.12.4
  • Matplotlib Version: 2.0.0
  • Python Version: 2.7.13
  • Jupyter Version (if applicable):
  • Other Libraries:

python and matplotlib installed with conda: Anaconda 4.3.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions