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

Skip to content

Commit b7e838a

Browse files
committed
issue test runs but fails comparison
1 parent e40b493 commit b7e838a

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,3 +707,28 @@ def test_removal():
707707
fig.canvas.draw()
708708
col.remove()
709709
fig.canvas.draw()
710+
@image_comparison(['anchored_locator_base_call.png'],style='classic')
711+
def test_anchored_locator_base_call():
712+
fig = plt.figure(figsize=(3,3))
713+
fig1, fig2 = fig.subfigures(nrows=2, ncols=1, height_ratios=[1, 1], squeeze=True)
714+
715+
ax = fig1.subplots()
716+
ax.set(aspect=1, xlim=(-15, 15), ylim=(-20, 5))
717+
718+
Z = cbook.get_sample_data("axes_grid/bivariate_normal.npy", np_load=True)
719+
extent = (-3, 4, -4, 3)
720+
721+
axins = zoomed_inset_axes(ax, zoom=2, loc='upper left')
722+
axins.set(xticks=[], yticks=[])
723+
im = axins.imshow(Z, extent=extent, origin="lower")
724+
725+
# colorbar
726+
cax = inset_axes(axins,
727+
width="5%", # width = 10% of parent_bbox width
728+
height="100%", # height : 50%
729+
loc='lower left',
730+
bbox_to_anchor=(1.05, 0., 1, 1),
731+
bbox_transform=axins.transAxes,
732+
borderpad=0,
733+
)
734+
fig.colorbar(im, cax=cax)

0 commit comments

Comments
 (0)