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

Skip to content

Commit c65c911

Browse files
committed
Less pyplot, more OO in docs.
1 parent 3a265b3 commit c65c911

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

examples/axes_grid1/demo_colorbar_of_inset_axes.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,15 @@
1010

1111

1212
fig, ax = plt.subplots(figsize=[5, 4])
13+
ax.set(aspect=1, xlim=(-15, 15), ylim=(-20, 5))
1314

1415
Z = cbook.get_sample_data("axes_grid/bivariate_normal.npy", np_load=True)
1516
extent = (-3, 4, -4, 3)
1617

17-
ax.set(aspect=1, xlim=(-15, 15), ylim=(-20, 5))
18-
1918
axins = zoomed_inset_axes(ax, zoom=2, loc='upper left')
19+
axins.set(xticks=[], yticks=[])
2020
im = axins.imshow(Z, extent=extent, origin="lower")
2121

22-
plt.xticks(visible=False)
23-
plt.yticks(visible=False)
24-
2522
# colorbar
2623
cax = inset_axes(axins,
2724
width="5%", # width = 10% of parent_bbox width

0 commit comments

Comments
 (0)