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

Skip to content

Commit ad02561

Browse files
committed
Fixed a handlelegth bug in the legend class
svn path=/trunk/matplotlib/; revision=6499
1 parent 4ae534b commit ad02561

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2008-12-05 Fixed a bug that the handlelength of the new legend class
2+
set too short when numpoints=1 -JJL
3+
14
2008-12-04 Added support for data with units (e.g. dates) to
25
Axes.fill_between. -RM
36

lib/matplotlib/legend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ def _init_legend_box(self, handles, labels):
418418
npoints)
419419
xdata_marker = xdata
420420
elif npoints == 1:
421-
xdata = np.linspace(0, self.handlelength, 2)
421+
xdata = np.linspace(0, self.handlelength*self.fontsize, 2)
422422
xdata_marker = [0.5*self.handlelength*self.fontsize]
423423

424424
if isinstance(handle, Line2D):

0 commit comments

Comments
 (0)