[Python-modules-commits] [python-mplexporter] 122/135: BUG: pass collections through legend

Wolfgang Borgert debacle at moszumanska.debian.org
Tue Sep 23 21:19:11 UTC 2014


This is an automated email from the git hooks/post-receive script.

debacle pushed a commit to branch master
in repository python-mplexporter.

commit 23d511a18f9d7700a8b34b635121b0b05926b98f
Author: Jake Vanderplas <vanderplas at astro.washington.edu>
Date:   Fri May 2 14:58:12 2014 -0700

    BUG: pass collections through legend
---
 mplexporter/exporter.py | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/mplexporter/exporter.py b/mplexporter/exporter.py
index 62817d6..19a61ec 100644
--- a/mplexporter/exporter.py
+++ b/mplexporter/exporter.py
@@ -9,7 +9,7 @@ import io
 from . import utils
 
 import matplotlib
-from matplotlib import transforms
+from matplotlib import transforms, collections
 
 
 class Exporter(object):
@@ -167,6 +167,9 @@ class Exporter(object):
                         self.draw_text(ax, child, force_trans=ax.transAxes)
                 elif isinstance(child, matplotlib.lines.Line2D):
                     self.draw_line(ax, child, force_trans=ax.transAxes)
+                elif isinstance(child, matplotlib.collections.Collection):
+                    self.draw_collection(ax, child,
+                                         force_pathtrans=ax.transAxes)
                 else:
                     warnings.warn("Legend element %s not impemented" % child)
             except NotImplementedError:
@@ -230,12 +233,12 @@ class Exporter(object):
 
         offset_coords, offsets = self.process_transform(
             transOffset, ax, offsets, force_trans=force_offsettrans)
+        path_coords = self.process_transform(
+            transform, ax, force_trans=force_pathtrans)
 
         processed_paths = [utils.SVG_path(path) for path in paths]
-        path_coords, tr = self.process_transform(
-            transform, ax, return_trans=True, force_trans=force_pathtrans)
-
-        processed_paths = [(tr.transform(path[0]), path[1])
+        processed_paths = [(self.process_transform(
+            transform, ax, path[0], force_trans=force_pathtrans)[1], path[1])
                            for path in processed_paths]
 
         path_transforms = collection.get_transforms()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-mplexporter.git



More information about the Python-modules-commits mailing list