Skip to content

Expose position arg on geom_hline() and geom_vline() #5965

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@
the `nbin` argument (@teunbrand, #5882, #5036)
* `after_stat()` and `after_scale()` throw warnings when the computed aesthetics
are not of the correct length (#5901).
* `geom_hline()` and `geom_vline()` now have `position` argument
(@yutannihilation, #4285).

# ggplot2 3.5.1

Expand Down
3 changes: 2 additions & 1 deletion R/geom-hline.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ NULL
#' @export
#' @rdname geom_abline
geom_hline <- function(mapping = NULL, data = NULL,
position = "identity",
...,
yintercept,
na.rm = FALSE,
Expand All @@ -29,7 +30,7 @@ geom_hline <- function(mapping = NULL, data = NULL,
mapping = mapping,
stat = StatIdentity,
geom = GeomHline,
position = PositionIdentity,
position = position,
show.legend = show.legend,
inherit.aes = FALSE,
params = list2(
Expand Down
3 changes: 2 additions & 1 deletion R/geom-vline.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ NULL
#' @export
#' @rdname geom_abline
geom_vline <- function(mapping = NULL, data = NULL,
position = "identity",
...,
xintercept,
na.rm = FALSE,
Expand All @@ -29,7 +30,7 @@ geom_vline <- function(mapping = NULL, data = NULL,
mapping = mapping,
stat = StatIdentity,
geom = GeomVline,
position = PositionIdentity,
position = position,
show.legend = show.legend,
inherit.aes = FALSE,
params = list2(
Expand Down
15 changes: 15 additions & 0 deletions man/geom_abline.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.