8000 TST: add inset axes test · matplotlib/matplotlib@5baf6ac · GitHub
[go: up one dir, main page]

Skip to content

Commit 5baf6ac

Browse files
committed
TST: add inset axes test
1 parent 84a9e3a commit 5baf6ac

File tree

3 files changed

+4
-19
lines changed

3 files changed

+4
-19
lines changed

examples/subplots_axes_and_figures/zoom_inset_axes.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,7 @@ def get_demo_image():
3131
origin="lower")
3232

3333
# inset axes....
34-
<<<<<<< HEAD
3534
axins = ax.inset_axes_rect([0.5, 0.5, 0.47, 0.47])
36-
=======
37-
axins = ax.inset_axes([0.5, 0.5, 0.47, 0.47])
38-
>>>>>>> 97a72b10a... DOC: add inset axes example
3935
axins.imshow(Z2, extent=extent, interpolation="nearest",
4036
origin="lower")
4137
# sub region of the original image
@@ -45,11 +41,7 @@ def get_demo_image():
4541
axins.set_xticklabels('')
4642
axins.set_yticklabels('')
4743

48-
<<<<<<< HEAD
4944
ax.zoom_inset_indicator(axins)
50-
=======
51-
ax.zoom_inset_rectangle(axins)
52-
>>>>>>> 97a72b10a... DOC: add inset axes example
5345

5446
plt.show()
5547

@@ -63,11 +55,6 @@ def get_demo_image():
6355
# The use of the following functions and methods is shown in this example:
6456

6557
import matplotlib
66-
<<<<<<< HEAD
6758
matplotlib.axes.Axes.inset_axes_rect
6859
matplotlib.axes.Axes.zoom_inset_indicator
69-
=======
70-
matplotlib.axes.Axes.inset_axes
71-
matplotlib.axes.Axes.zoom_inset_rectangle
72-
>>>>>>> 97a72b10a... DOC: add inset axes example
7360
matplotlib.axes.Axes.imshow

lib/matplotlib/axes/_axes.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,8 @@ def inset_axes_rect(self, rect, *, transform=None, zorder=5,
466466
# this locator lets the axes move if in data coordinates.
467467
# it gets called in `ax.apply_aspect() (of all places)
468468
inset_ax.set_axes_locator(inset_locator)
469-
470-
self.add_child_axes(inset_ax)
471469

470+
self.add_child_axes(inset_ax)
472471

473472
return inset_ax
474473

@@ -541,11 +540,11 @@ def inset_indicator(self, rect, inset_ax=None, *, transform=None,
541540
zorder=zorder, label=label, transform=transform, **kwargs)
542541
self.add_patch(rectpatch)
543542

544-
if not inset_ax is None:
543+
if inset_ax is not None:
545544
# want to connect the indicator to the rect....
546545

547-
pos = inset_ax.get_position() # this is in fig-fraction.
548-
coordsA='axes fraction'
546+
pos = inset_ax.get_position() # this is in fig-fraction.
547+
coordsA = 'axes fraction'
549548
connects = []
550549
xr = [rect[0], rect[0]+rect[2]]
551550
yr = [rect[1], rect[1]+rect[3]]

lib/matplotlib/axes/_base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1836,7 +1836,6 @@ def add_child_axes(self, ax):
18361836
ax._axes = self
18371837
ax.stale_callback = martist._stale_axes_callback
18381838

1839-
18401839
self.child_axes.append(ax)
18411840
ax._remove_method = self.child_axes.remove
18421841
self.stale = True

0 commit comments

Comments
 (0)
0