Skip to content

Conversation

@teunbrand
Copy link
Collaborator

This PR aims to fix #6481.

Briefly, it adds the arrow and arrow.fill arguments to the geoms mentioned in the title.
Examples:

devtools::load_all("~/packages/ggplot2/")
#> ℹ Loading ggplot2

df <- data.frame(
  trt = c("A", "A", "B", "B"),
  resp = c(1, 5, 3, 4),
  group = factor(c(1, 2, 1, 2)),
  upper = c(1.1, 5.3, 3.3, 4.2),
  lower = c(0.8, 4.6, 2.4, 3.6)
)

staple <- arrow(angle = 90, length = unit(2, "mm"), ends = "both")

p <- ggplot(df, aes(trt, resp, colour = group, ymin = lower, ymax = upper))
p + geom_linerange(arrow = staple)

p + geom_pointrange(arrow = staple)

Created on 2025-05-27 with reprex v2.1.1

Copy link
Member

@thomasp85 thomasp85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NEWS bullet? otherwise LGTM

teunbrand and others added 3 commits December 4, 2025 14:04
Merge branch 'main' into geom_xrange_arrow

# Conflicts:
#	R/geom-linerange.R
#	man/geom_linerange.Rd
@teunbrand teunbrand merged commit 6094a23 into tidyverse:main Dec 4, 2025
13 checks passed
@teunbrand teunbrand deleted the geom_xrange_arrow branch December 4, 2025 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support arrow for geom_linerange() and geom_pointrange()

2 participants