Revision: 6818
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6818&view=rev
Author:   jdh2358
Date:     2009-01-22 03:06:44 +0000 (Thu, 22 Jan 2009)

Log Message:
-----------
fixed line collections legmarker sf bug 2511280

Modified Paths:
--------------
    branches/v0_98_5_maint/lib/matplotlib/legend.py

Modified: branches/v0_98_5_maint/lib/matplotlib/legend.py
===================================================================
--- branches/v0_98_5_maint/lib/matplotlib/legend.py     2009-01-22 02:54:23 UTC 
(rev 6817)
+++ branches/v0_98_5_maint/lib/matplotlib/legend.py     2009-01-22 03:06:44 UTC 
(rev 6818)
@@ -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.

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to