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

Should element_rect() and element_line() also use linewidth instead of size? #4953

Closed
yutannihilation opened this issue Aug 21, 2022 · 1 comment · Fixed by #4956
Closed
Milestone

Comments

@yutannihilation
Copy link
Member

#3672 introduced linewidth to Geoms. On the other hand, element_rect() and element_line() still uses size. Do we need to rename them for consistency?

Currently, this doesn't work.

library(ggplot2)

ggplot(mpg, aes(x = hwy, y = cty, color = drv)) +
  geom_point() +
  theme(
    legend.key = element_rect(linewidth = 3, colour = "red")
  )
#> Error in element_rect(linewidth = 3, colour = "red"): unused argument (linewidth = 3)

Created on 2022-08-22 with reprex v2.0.2

@thomasp85
Copy link
Member

I think we should, but we should be careful to properly deprecate the size argument... I can take a stab at this

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 a pull request may close this issue.

2 participants