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

Using lwd parameter in geom_line() produces size warning #5051

Closed
sarmapar opened this issue Nov 16, 2022 · 2 comments · Fixed by #5072
Closed

Using lwd parameter in geom_line() produces size warning #5051

sarmapar opened this issue Nov 16, 2022 · 2 comments · Fixed by #5072

Comments

@sarmapar
Copy link

I recently updated ggplot and found I am getting the "Using size aesthetic for lines was deprecated in ggplot2 3.4.0." warning for my lines of code where I use the lwd parameter. Is lwd also being deprecated? I think a more clear/informative warning would be helpful, because it took me a while to find the source since I didn't explicitly use size anywhere.

Simplified example that produces the warning:

library(ggplot2)

ggplot(economics, aes(date, unemploy)) + 
   geom_line(lwd = 0.25)
@clauswilke
Copy link
Member

Good point. I think it's an oversight, lwd should be mapped onto the new linewidth aesthetic, and not onto size. This happens here:

"lwd" = "size",

In general, though, I think it's better to not use these base-R terms at all but rather use the correct ggplot2 aesthetic.

@thomasp85
Copy link
Member

Agree with @clauswilke on all accounts. This was an oversight by me

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.

3 participants