Skip to content

Commit ea27e33

Browse files
committed
Fix mapping geom_hline & geom_vline to discrete variables
1 parent 443d904 commit ea27e33

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

doc/changelog.qmd

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,12 @@ title: Changelog
137137
- Fixed bug in [](:class:`~plotnine.geom_histogram`) where mapping to the `weight` aesthetic
138138
lead to an error. {{< issue 936 >}}
139139

140+
- Fixed bug in [](:class:`~plotnine.geom_vline`) where you could not map the `xintercept`
141+
aesthetic to a discrete variable.
142+
143+
- Fixed bug in [](:class:`~plotnine.geom_hline`) where you could not map the `yintercept`
144+
aesthetic to a discrete variable.
145+
140146
## v0.14.5
141147
(2025-01-02)
142148
[![](https://zenodo.org/badge/DOI/10.5281/zenodo.14587381.svg)](https://doi.org/10.5281/zenodo.14587381)

plotnine/scales/scale_xy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ class scale_x_discrete(scale_position_discrete):
213213
Discrete x position
214214
"""
215215

216-
_aesthetics = ["x", "xmin", "xmax", "xend"]
216+
_aesthetics = ["x", "xmin", "xmax", "xend", "xintercept"]
217217

218218

219219
@dataclass(kw_only=True)
@@ -222,7 +222,7 @@ class scale_y_discrete(scale_position_discrete):
222222
Discrete y position
223223
"""
224224

225-
_aesthetics = ["y", "ymin", "ymax", "yend"]
225+
_aesthetics = ["y", "ymin", "ymax", "yend", "yintercept"]
226226

227227

228228
# Not part of the user API

0 commit comments

Comments
 (0)