Skip to content

Commit fb33e26

Browse files
Expose position arg on geom_hline() and geom_vline() (#5965)
1 parent 46ae89f commit fb33e26

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@
104104
the `nbin` argument (@teunbrand, #5882, #5036)
105105
* `after_stat()` and `after_scale()` throw warnings when the computed aesthetics
106106
are not of the correct length (#5901).
107+
* `geom_hline()` and `geom_vline()` now have `position` argument
108+
(@yutannihilation, #4285).
107109

108110
# ggplot2 3.5.1
109111

R/geom-hline.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ NULL
44
#' @export
55
#' @rdname geom_abline
66
geom_hline <- function(mapping = NULL, data = NULL,
7+
position = "identity",
78
...,
89
yintercept,
910
na.rm = FALSE,
@@ -29,7 +30,7 @@ geom_hline <- function(mapping = NULL, data = NULL,
2930
mapping = mapping,
3031
stat = StatIdentity,
3132
geom = GeomHline,
32-
position = PositionIdentity,
33+
position = position,
3334
show.legend = show.legend,
3435
inherit.aes = FALSE,
3536
params = list2(

R/geom-vline.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ NULL
44
#' @export
55
#' @rdname geom_abline
66
geom_vline <- function(mapping = NULL, data = NULL,
7+
position = "identity",
78
...,
89
xintercept,
910
na.rm = FALSE,
@@ -29,7 +30,7 @@ geom_vline <- function(mapping = NULL, data = NULL,
2930
mapping = mapping,
3031
stat = StatIdentity,
3132
geom = GeomVline,
32-
position = PositionIdentity,
33+
position = position,
3334
show.legend = show.legend,
3435
inherit.aes = FALSE,
3536
params = list2(

man/geom_abline.Rd

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)