From: <jd...@us...> - 2009-01-22 03:12:57
|
Revision: 6819 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6819&view=rev Author: jdh2358 Date: 2009-01-22 03:12:53 +0000 (Thu, 22 Jan 2009) Log Message: ----------- Merged revisions 6818 via svnmerge from https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_98_5_maint ........ r6818 | jdh2358 | 2009-01-21 21:06:44 -0600 (Wed, 21 Jan 2009) | 1 line fixed line collections legmarker sf bug 2511280 ........ Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/legend.py Property Changed: ---------------- trunk/matplotlib/ Property changes on: trunk/matplotlib ___________________________________________________________________ Modified: svnmerge-integrated - /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6816 + /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6818 Modified: trunk/matplotlib/lib/matplotlib/legend.py =================================================================== --- trunk/matplotlib/lib/matplotlib/legend.py 2009-01-22 03:06:44 UTC (rev 6818) +++ trunk/matplotlib/lib/matplotlib/legend.py 2009-01-22 03:12:53 UTC (rev 6819) @@ -272,7 +272,7 @@ self._set_artist_props(self.legendPatch) self._drawFrame = True - + # init with null renderer self._init_legend_box(handles, labels) @@ -327,9 +327,9 @@ def findoffset(width, height, xdescent, ydescent): return _findoffset(width, height, xdescent, ydescent, renderer) - + self._legend_box.set_offset(findoffset) - + fontsize = renderer.points_to_pixels(self.fontsize) # if mode == fill, set the width of the legend_box to the @@ -623,8 +623,11 @@ ydata = ((height-descent)/2.)*np.ones(xdata.shape, float) legline.set_data(xdata, ydata) - legline_marker = legline._legmarker - legline_marker.set_data(xdata_marker, ydata[:len(xdata_marker)]) + # if a line collection is added, the legmarker attr is + # not set so we don't need to handle it + if hasattr(handle, "_legmarker"): + legline_marker = legline._legmarker + legline_marker.set_data(xdata_marker, ydata[:len(xdata_marker)]) elif isinstance(handle, Patch): p = handle @@ -765,7 +768,7 @@ C:"C"} c = anchor_coefs[loc] - + fontsize = renderer.points_to_pixels(self.fontsize) container = parentbbox.padded(-(self.borderaxespad) * fontsize) anchored_box = bbox.anchored(c, container=container) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |