Skip to content

Commit 11075eb

Browse files
committed
simplify creation of transparent legend
1 parent 310a889 commit 11075eb

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

doc/users/recipes.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,7 @@ nice to make the legend frame transparent.
330330
ax.plot(np.random.randn(300), 'o-', label='normal distribution')
331331
ax.plot(np.random.rand(300), 's-', label='uniform distribution')
332332
ax.set_ylim(-3, 3)
333-
leg = ax.legend(loc='best', fancybox=True)
334-
leg.get_frame().set_alpha(0.5)
333+
ax.legend(loc='best', fancybox=True, framealpha=0.5)
335334

336335
ax.set_title('fancy, transparent legends')
337336

0 commit comments

Comments
 (0)