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

geom_path has a default size of 0.5 #4094

Closed
2011 opened this issue Jun 26, 2020 · 4 comments
Closed

geom_path has a default size of 0.5 #4094

2011 opened this issue Jun 26, 2020 · 4 comments

Comments

@2011
Copy link

2011 commented Jun 26, 2020

I just started using rstudio a few weeks ago (and ggplot2 for just a couple of weeks), but if this doesn't count as a bug, it certainly represents an inconsistency. In geom_point for example, size = 0.5 reduces the size of the dots, but with geom_path, it produces the same line as omitting the size parameter, and geom_path, size = 1 produces a thicker line (I assume twice as thick).

ggplot() + geom_path(aes(disp, mpg), mtcars, size = 1)
@yutannihilation
Copy link
Member

Default aes can vary depending on the type of Geom. It might not fit on every cases, but it is what it is. For example, you might argue points and line should have the same default, but it might be inconvenient when you try to draw both.

library(ggplot2)

ggplot(mtcars, aes(disp, mpg)) +
  geom_line()+
  geom_point()

# points are absorbed
ggplot(mtcars, aes(disp, mpg)) +
  geom_line(size = 1.5)+
  geom_point(size = 1.5, stroke = 0)

Created on 2020-06-30 by the reprex package (v0.3.0)

@2011
Copy link
Author

2011 commented Jul 1, 2020

@yutannihilation I understand that different geoms might need different aes characteristics, but when a user omits a size parameter, he should get a the equivalent of "size = 1", so that adjustments can start from there. I have no objection to having "size = 1" produce the line that omitting the size parameter or using "size = 0.5" presently does, but the current situation (where the user does not even know the starting point when attempting to adjust the size), seems both not user friendly and just plain wrong.

@yutannihilation
Copy link
Member

I too think it's nice if there's some easy way to see the default values more easily. But it's not worth changing the default values, which changes the visual of the existing code without size specified.

@2011
Copy link
Author

2011 commented Jul 1, 2020

Seeing the default values would help. I don't know anything about the defaults for other geoms (as I said, I just started using ggplot2 a couple of weeks ago).

schloerke added a commit to ggobi/ggally that referenced this issue Jun 19, 2021
From news in 3.3.4:

```
It is now deprecated to specify guides(<scale> = FALSE) or scale_*(guide = FALSE) to remove a guide. Please use guides(<scale> = "none") or scale_*(guide = "none") instead (yutannihilation, tidyverse/ggplot2#4094).
```
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

No branches or pull requests

2 participants