[Python-modules-commits] [python-mplexporter] 49/135: update patch fill properties
Wolfgang Borgert
debacle at moszumanska.debian.org
Tue Sep 23 21:19:02 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 610ce8ea308ccefab050ff43aa3ebf9128a43d68
Author: Jake Vanderplas <vanderplas at astro.washington.edu>
Date: Tue Feb 25 13:51:57 2014 -0800
update patch fill properties
---
mplexporter/exporter.py | 2 +-
mplexporter/utils.py | 7 +++++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/mplexporter/exporter.py b/mplexporter/exporter.py
index f94a9e7..569e9ec 100644
--- a/mplexporter/exporter.py
+++ b/mplexporter/exporter.py
@@ -170,7 +170,7 @@ class Exporter(object):
transform = patch.get_transform()
coordinates, vertices = self.process_transform(transform,
ax, vertices)
- linestyle = utils.get_path_style(patch)
+ linestyle = utils.get_path_style(patch, fill=patch.get_fill())
self.renderer.draw_path(vertices,
coordinates=coordinates,
pathcodes=pathcodes,
diff --git a/mplexporter/utils.py b/mplexporter/utils.py
index 96079f9..cfbac22 100644
--- a/mplexporter/utils.py
+++ b/mplexporter/utils.py
@@ -113,14 +113,17 @@ def SVG_path(path, transform=None, simplify=False):
return vertices, list(codes)
-def get_path_style(path):
+def get_path_style(path, fill=True):
"""Get the style dictionary for matplotlib path objects"""
style = {}
style['alpha'] = path.get_alpha()
if style['alpha'] is None:
style['alpha'] = 1
style['edgecolor'] = color_to_hex(path.get_edgecolor())
- style['facecolor'] = color_to_hex(path.get_facecolor())
+ if fill:
+ style['facecolor'] = color_to_hex(path.get_facecolor())
+ else:
+ style['facecolor'] = 'none'
style['edgewidth'] = path.get_linewidth()
style['dasharray'] = get_dasharray(path)
style['zorder'] = path.get_zorder()
--
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