Skip to content

DOC: nudges legend position in tutorial to be within graph area #12377

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

Closed
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
4 changes: 2 additions & 2 deletions tutorials/intermediate/constrainedlayout_guide.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def example_plot(ax, fontsize=12, nodec=False):
for ax in axs.flatten()[:-1]:
ax.plot(np.arange(10))
axs[1, 1].plot(np.arange(10), label='This is a plot')
leg = axs[1, 1].legend(loc='center left', bbox_to_anchor=(0.8, 0.5))
leg = axs[1, 1].legend(loc='center left', bbox_to_anchor=(0.4, 0.3))
leg.set_in_layout(False)
wanttoprint = False
if wanttoprint:
Expand All @@ -236,7 +236,7 @@ def example_plot(ax, fontsize=12, nodec=False):
lines = axs[1, 1].plot(np.arange(10), label='This is a plot')
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, 1].transAxes)
bbox_to_anchor=(0.4, 0.3), bbox_transform=axs[1, 1].transAxes)

###############################################################################
# Padding and Spacing
Expand Down