From 4e95d6c0aad93ed6916ca7d06cf5034b203dad15 Mon Sep 17 00:00:00 2001 From: Greg Lamp Date: Mon, 28 Apr 2014 12:52:35 -0400 Subject: [PATCH] bump version; support for lists in vline and hline --- ggplot/__init__.py | 2 +- ggplot/geoms/geom_hline.py | 10 ++++++++-- ggplot/geoms/geom_vline.py | 8 +++++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ggplot/__init__.py b/ggplot/__init__.py index 6acca3ed..bd992acf 100644 --- a/ggplot/__init__.py +++ b/ggplot/__init__.py @@ -16,7 +16,7 @@ def _set_mpl_backend(): # This is the only place the version is specified and # used in both setup.py and docs/conf.py to set the # version of ggplot. -__version__ = '0.5.4' +__version__ = '0.5.5' from .qplot import qplot from .ggplot import ggplot diff --git a/ggplot/geoms/geom_hline.py b/ggplot/geoms/geom_hline.py index 12aa97d1..3c979b27 100644 --- a/ggplot/geoms/geom_hline.py +++ b/ggplot/geoms/geom_hline.py @@ -14,6 +14,12 @@ class geom_hline(geom): def _plot_unit(self, pinfo, ax): pinfo['label'] = self.params['label'] - ax.axhline(**pinfo) - + pinfo['label'] = self.params['label'] + if isinstance(pinfo['y'], list): + ys = pinfo['y'] + for y in ys: + pinfo['y'] = y + ax.axhline(**pinfo) + else: + ax.axhline(**pinfo) diff --git a/ggplot/geoms/geom_vline.py b/ggplot/geoms/geom_vline.py index ed96176d..c045a342 100644 --- a/ggplot/geoms/geom_vline.py +++ b/ggplot/geoms/geom_vline.py @@ -14,4 +14,10 @@ class geom_vline(geom): def _plot_unit(self, pinfo, ax): pinfo['label'] = self.params['label'] - ax.axvline(**pinfo) + if isinstance(pinfo['x'], list): + xs = pinfo['x'] + for x in xs: + pinfo['x'] = x + ax.axvline(**pinfo) + else: + ax.axvline(**pinfo)