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

Skip to content

Commit 3bcf82b

Browse files
authored
Merge pull request #26295 from anntzer/dip
Deprecate inset_locator.InsetPosition.
2 parents 3044bde + ccc6fc4 commit 3bcf82b

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
``inset_location.InsetPosition`` is deprecated
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
Use `~.Axes.inset_axes` instead.

lib/mpl_toolkits/axes_grid1/inset_locator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from .parasite_axes import HostAxes
1414

1515

16+
@_api.deprecated("3.8", alternative="Axes.inset_axes")
1617
class InsetPosition:
1718
@_docstring.dedent_interpd
1819
def __init__(self, parent, lbwh):

lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,8 @@ def test_rgb_axes():
701701
def test_insetposition():
702702
fig, ax = plt.subplots(figsize=(2, 2))
703703
ax_ins = plt.axes([0, 0, 1, 1])
704-
ip = InsetPosition(ax, [0.2, 0.25, 0.5, 0.4])
704+
with pytest.warns(mpl.MatplotlibDeprecationWarning):
705+
ip = InsetPosition(ax, [0.2, 0.25, 0.5, 0.4])
705706
ax_ins.set_axes_locator(ip)
706707

707708

0 commit comments

Comments
 (0)