8000 DOC: Add missing examples for legend outside positions · matplotlib/matplotlib@aeda076 · GitHub
[go: up one dir, main page]

Skip to content

Commit aeda076

Browse files
committed
DOC: Add missing examples for legend outside positions
Also made the background lighter, which IMHO looks more pleasing.
1 parent 685ea2b commit aeda076

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

galleries/users_explain/axes/legend_guide.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175
#
176176
ucl = ['upper', 'center', 'lower']
177177
lcr = ['left', 'center', 'right']
178-
fig, ax = plt.subplots(figsize=(6, 4), layout='constrained', facecolor='0.7')
178+
fig, ax = plt.subplots(figsize=(6, 4), layout='constrained', facecolor='0.95')
179179

180180
ax.plot([1, 2], [1, 2], label='TEST')
181181
# Place a legend to the right of this smaller subplot.
@@ -188,12 +188,14 @@
188188
'outside lower right']:
189189
fig.legend(loc=loc, title=loc)
190190

191-
fig, ax = plt.subplots(figsize=(6, 4), layout='constrained', facecolor='0.7')
191+
fig, ax = plt.subplots(figsize=(6, 4), layout='constrained', facecolor='0.95')
192192
ax.plot([1, 2], [1, 2], label='test')
193193

194194
for loc in [
195195
'outside left upper',
196196
'outside right upper',
197+
'outside left center',
198+
'outside right center',
197199
'outside left lower',
198200
'outside right lower']:
199201
fig.legend(loc=loc, title=loc)

0 commit comments

Comments
 (0)
0