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

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()
1 participant