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

Skip to content

Commit 75c3955

Browse files
committed
some legend fixes
svn path=/trunk/matplotlib/; revision=6022
1 parent c50dcc3 commit 75c3955

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

lib/matplotlib/axes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6364,7 +6364,7 @@ def hist(self, x, bins=10, range=None, normed=False, cumulative=False,
63646364
for p in patch:
63656365
p.update(kwargs)
63666366
p.set_label(label)
6367-
label = '_nolegend'
6367+
label = '_nolegend_'
63686368

63696369

63706370
if len(n)==1:

lib/matplotlib/legend.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,8 @@ def get_tbounds(text): #get text bounds in axes coords
520520
if isinstance(handle, Line2D):
521521
ydata = y*np.ones(handle.get_xdata().shape, float)
522522
handle.set_ydata(ydata+h/2.)
523-
handle._legmarker.set_ydata(ydata+h/2.)
523+
if hasattr(handle, '_legmarker'):
524+
handle._legmarker.set_ydata(ydata+h/2.)
524525
elif isinstance(handle, Rectangle):
525526
handle.set_y(y+1/4*h)
526527
handle.set_height(h/2)

0 commit comments

Comments
 (0)