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

Skip to content

Commit 2cf57ec

Browse files
authored
Merge pull request #18116 from meeseeksmachine/auto-backport-of-pr-17947-on-v3.3.0-doc
Backport PR #17947 on branch v3.3.0-doc (DOC: don't make CL tutorial save new file all the time)
2 parents 6b48aa1 + 63ddc75 commit 2cf57ec

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ examples/*/*.svgz
7979
examples/tests/*
8080
!examples/tests/backend_driver_sgskip.py
8181
result_images
82+
doc/_static/constrained_layout*.png
8283

8384
# Nose/Pytest generated files #
8485
###############################
-37.6 KB
Binary file not shown.
-10.3 KB
Binary file not shown.
-10.3 KB
Binary file not shown.

tutorials/intermediate/constrainedlayout_guide.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,13 @@ def example_plot(ax, fontsize=12, hide_labels=False):
229229
leg.set_in_layout(True)
230230
# we don't want the layout to change at this point.
231231
fig.set_constrained_layout(False)
232-
fig.savefig('CL01.png', bbox_inches='tight', dpi=100)
232+
fig.savefig('../../doc/_static/constrained_layout_1b.png',
233+
bbox_inches='tight', dpi=100)
233234

234235
#############################################
235236
# The saved file looks like:
236237
#
237-
# .. image:: /_static/constrained_layout/CL01.png
238+
# .. image:: /_static/constrained_layout_1b.png
238239
# :align: center
239240
#
240241
# A better way to get around this awkwardness is to simply
@@ -245,12 +246,13 @@ def example_plot(ax, fontsize=12, hide_labels=False):
245246
labels = [l.get_label() for l in lines]
246247
leg = fig.legend(lines, labels, loc='center left',
247248
bbox_to_anchor=(0.8, 0.5), bbox_transform=axs[1].transAxes)
248-
fig.savefig('CL02.png', bbox_inches='tight', dpi=100)
249+
fig.savefig('../../doc/_static/constrained_layout_2b.png',
250+
bbox_inches='tight', dpi=100)
249251

250252
#############################################
251253
# The saved file looks like:
252254
#
253-
# .. image:: /_static/constrained_layout/CL02.png
255+
# .. image:: /_static/constrained_layout_2b.png
254256
# :align: center
255257
#
256258

0 commit comments

Comments
 (0)