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

Skip to content

Commit abb2059

Browse files
authored
Merge pull request #26265 from tacaswell/doc/fix_tight_bbox_example
2 parents 1cc50f6 + a7b7b13 commit abb2059

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

galleries/users_explain/figure/figure_intro.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,9 @@ would be saved if ``bbox_inches='tight'`` were used in savefig.
251251
ax.set_aspect(1)
252252
bb = ax.get_tightbbox()
253253
bb = bb.padded(10)
254+
bb = bb.transformed(fig.dpi_scale_trans.inverted())
254255
fancy = FancyBboxPatch(bb.p0, bb.width, bb.height, fc='none',
255256
ec=(0, 0.0, 0, 0.5), lw=2, linestyle='--',
256-
transform=None, clip_on=False)
257+
transform=fig.dpi_scale_trans,
258+
clip_on=False, boxstyle='Square, pad=0')
257259
ax.add_patch(fancy)

0 commit comments

Comments
 (0)