Skip to content

Commit 514fbb1

Browse files
authored
Merge pull request #21869 from meeseeksmachine/auto-backport-of-pr-21866-on-v3.5.x
Backport PR #21866 on branch v3.5.x (Shorten some inset_locator docstrings.)
2 parents d6bb1a2 + 1fcae98 commit 514fbb1

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

examples/subplots_axes_and_figures/axes_zoom_effect.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,14 @@ def zoom_effect02(ax1, ax2, **kwargs):
109109
return c1, c2, bbox_patch1, bbox_patch2, p
110110

111111

112-
plt.figure(figsize=(5, 5))
113-
ax1 = plt.subplot(221)
114-
ax2 = plt.subplot(212)
115-
ax2.set_xlim(0, 1)
116-
ax2.set_xlim(0, 5)
117-
zoom_effect01(ax1, ax2, 0.2, 0.8)
118-
119-
120-
ax1 = plt.subplot(222)
121-
ax1.set_xlim(2, 3)
122-
ax2.set_xlim(0, 5)
123-
zoom_effect02(ax1, ax2)
112+
axs = plt.figure().subplot_mosaic([
113+
["zoom1", "zoom2"],
114+
["main", "main"],
115+
])
116+
117+
axs["main"].set(xlim=(0, 5))
118+
zoom_effect01(axs["zoom1"], axs["main"], 0.2, 0.8)
119+
axs["zoom2"].set(xlim=(2, 3))
120+
zoom_effect02(axs["zoom2"], axs["main"])
124121

125122
plt.show()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy