Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion ggplot/geoms/geom_hline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 7 additions & 2 deletions ggplot/geoms/geom_vline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down