[Python-modules-commits] [python-mplexporter] 120/135: mpl 1.4 compat: handle collection transforms correctly

Wolfgang Borgert debacle at moszumanska.debian.org
Tue Sep 23 21:19:10 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 ed8da9e3dc54e7560bb35ae90dcd1b7151e7d43f
Author: Jake Vanderplas <vanderplas at astro.washington.edu>
Date:   Thu Apr 17 08:04:39 2014 -0700

    mpl 1.4 compat: handle collection transforms correctly
---
 mplexporter/exporter.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/mplexporter/exporter.py b/mplexporter/exporter.py
index b43e405..62817d6 100644
--- a/mplexporter/exporter.py
+++ b/mplexporter/exporter.py
@@ -237,7 +237,16 @@ class Exporter(object):
 
         processed_paths = [(tr.transform(path[0]), path[1])
                            for path in processed_paths]
+
         path_transforms = collection.get_transforms()
+        try:
+            # matplotlib 1.3: path_transforms are transform objects.
+            # Convert them to numpy arrays.
+            path_transforms = [t.get_matrix() for t in path_transforms]
+        except AttributeError:
+            # matplotlib 1.4: path transforms are already numpy arrays.
+            pass
+
         styles = {'linewidth': collection.get_linewidths(),
                   'facecolor': collection.get_facecolors(),
                   'edgecolor': collection.get_edgecolors(),

-- 
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