Skip to content

DOC: don't make CL tutorial save new file all the time #17947

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ examples/*/*.svgz
examples/tests/*
!examples/tests/backend_driver_sgskip.py
result_images
doc/_static/constrained_layout*.png

# Nose/Pytest generated files #
###############################
Expand Down
Binary file removed doc/_static/constrained_layout/CL00.png
Binary file not shown.
Binary file removed doc/_static/constrained_layout/CL01.png
Binary file not shown.
Binary file removed doc/_static/constrained_layout/CL02.png
Binary file not shown.
10 changes: 6 additions & 4 deletions tutorials/intermediate/constrainedlayout_guide.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,13 @@ def example_plot(ax, fontsize=12, hide_labels=False):
leg.set_in_layout(True)
# we don't want the layout to change at this point.
fig.set_constrained_layout(False)
fig.savefig('CL01.png', bbox_inches='tight', dpi=100)
fig.savefig('../../doc/_static/constrained_layout_1b.png',
bbox_inches='tight', dpi=100)

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

#############################################
# The saved file looks like:
#
# .. image:: /_static/constrained_layout/CL02.png
# .. image:: /_static/constrained_layout_2b.png
# :align: center
#

Expand Down