Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit65044a2

Browse files
authored
Merge pull request#24932 from dstansby/auto-backport-of-pr-24783-on-v3.6.x
"Backport PR#24783 on branch v3.6.x (inset locator fix with tests added)"
2 parents49aa465 +5e2bf2c commit65044a2

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

‎lib/mpl_toolkits/axes_grid1/inset_locator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def __call__(self, ax, renderer):
7878

7979
px,py=self.get_offset(width,height,0,0,renderer)
8080
bbox_canvas=Bbox.from_bounds(px,py,width,height)
81-
tr=ax.figure.transFigure.inverted()
81+
tr=ax.figure.transSubfigure.inverted()
8282
bb=TransformedBbox(bbox_canvas,tr)
8383

8484
returnbb

‎lib/mpl_toolkits/tests/test_axes_grid1.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,3 +579,23 @@ def test_removal():
579579
fig.canvas.draw()
580580
col.remove()
581581
fig.canvas.draw()
582+
583+
584+
@image_comparison(['anchored_locator_base_call.png'],style="mpl20")
585+
deftest_anchored_locator_base_call():
586+
fig=plt.figure(figsize=(3,3))
587+
fig1,fig2=fig.subfigures(nrows=2,ncols=1)
588+
589+
ax=fig1.subplots()
590+
ax.set(aspect=1,xlim=(-15,15),ylim=(-20,5))
591+
ax.set(xticks=[],yticks=[])
592+
593+
Z=cbook.get_sample_data(
594+
"axes_grid/bivariate_normal.npy",np_load=True
595+
)
596+
extent= (-3,4,-4,3)
597+
598+
axins=zoomed_inset_axes(ax,zoom=2,loc="upper left")
599+
axins.set(xticks=[],yticks=[])
600+
601+
axins.imshow(Z,extent=extent,origin="lower")

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp