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

Skip to content

Commit 92f0494

Browse files
matt256rcomer
authored andcommitted
issue test runs but fails comparison
1 parent f6514d5 commit 92f0494

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py

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

0 commit comments

Comments
 (0)