diff --git a/ggplot/geoms/geom_hline.py b/ggplot/geoms/geom_hline.py index 51c4661d..58fa293d 100755 --- a/ggplot/geoms/geom_hline.py +++ b/ggplot/geoms/geom_hline.py @@ -28,7 +28,13 @@ def plot(self, ax, data, _aes): (data, _aes) = self._update_data(data, _aes) params = self._get_plot_args(data, _aes) variables = _aes.data - y = self.params.get('y') + y = self.params.get('yintercept') + # for backwards compatibility, allow setting 'y' + if y is None: + y = self.params.get('y') + if y is None: + raise ValueError("yintercept is required for hline") + if is_iterable(y): for yi in y: ax.axhline(yi, **params) diff --git a/ggplot/geoms/geom_vline.py b/ggplot/geoms/geom_vline.py index 89f5dfe1..d1629b1d 100755 --- a/ggplot/geoms/geom_vline.py +++ b/ggplot/geoms/geom_vline.py @@ -27,8 +27,13 @@ def plot(self, ax, data, _aes): (data, _aes) = self._update_data(data, _aes) params = self._get_plot_args(data, _aes) variables = _aes.data - x = self.params.get('x') - + x = self.params.get('xintercept') + # for backwards compatibility, allow setting 'x' + if x is None: + x = self.params.get('x') + if x is None: + raise ValueError("xintercept is required for vline") + if is_iterable(x): for xi in x: ax.axvline(xi, **params)