Skip to content
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

Additional arrow.fill parameters for line-based functions. #5768

Merged
merged 7 commits into from
May 21, 2024

Conversation

teunbrand
Copy link
Collaborator

This PR aims to fix #5658.

Briefly, an arrow.fill parameter was either added or propagated in these functions:

  • geom_path() and thus by extension geom_line()
  • geom_function()
  • geom_sf() when drawing line geometries
  • element_line()

A demonstration of each of these:

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

my_arrow <- arrow(angle = 20, type = "closed")

ggplot(pressure, aes(temperature, pressure)) +
  geom_line(arrow = my_arrow, arrow.fill = "red")

ggplot() +
  geom_function(
    fun = dnorm, xlim = c(-2, 2), 
    arrow = my_arrow, arrow.fill = "red"
  )

ggplot(sf::st_linestring(as.matrix(pressure))) +
  geom_sf(arrow = my_arrow, arrow.fill = "red")

ggplot(mpg, aes(displ, hwy)) +
  geom_point() +
  theme(
    axis.line = element_line(arrow = my_arrow, arrow.fill = "red")
  )

Created on 2024-03-11 with reprex v2.1.0

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.

LGTM

Merge branch 'main' into arrow_fills

# Conflicts:
#	R/geom-path.R
#	R/geom-sf.R
#	R/theme-elements.R
@teunbrand
Copy link
Collaborator Author

teunbrand commented May 20, 2024

@thomasp85 Found out that geom_step() didn't have arrow settings either, so I included this function to.
I'll re-request a review.

@teunbrand teunbrand requested a review from thomasp85 May 20, 2024 10:56
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.

LGTM

@teunbrand teunbrand merged commit 341e8fc into tidyverse:main May 21, 2024
11 checks passed
@teunbrand teunbrand deleted the arrow_fills branch May 21, 2024 11:54
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.

Review arrow.fill argument to line geoms
2 participants