Yeah, it looks like this is a real bug (that only affects the 0.91.x
maintenance branch). LineCollection seemingly had get_lines() at one
point but it disappeared.
I have committed a fix to SVN and attached a patch against legend.py.
Cheers,
Mike
Yannick Copin wrote:
Hi,
I thought this AttributeError when using legend was solved a long time ago
(see http://article.gmane.org/gmane.comp.python.matplotlib.general/10306) but
I still face it in matplotlib 0.91.3, released 4 weeks ago (and this does not
seem to have changed in recent version of collections.py).
Can someone tell me what is the actual situation?
Cheers.
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
Index: lib/matplotlib/legend.py
===================================================================
--- lib/matplotlib/legend.py (revision 5705)
+++ lib/matplotlib/legend.py (working copy)
@@ -375,11 +375,11 @@
for handle in ax.collections:
if isinstance(handle, LineCollection):
- hlines = handle.get_lines()
+ hlines = handle._segments
trans = handle.get_transform()
for line in hlines:
tline = trans.seq_xy_tups(line)
- aline = [inv(v) for v in tline]
+ aline = [inv(tuple(v)) for v in tline]
lines.append(aline)
return [vertices, bboxes, lines]
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users