Skip to content

geom_hex ignores size aesthetic/parameter #2488

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

Closed
econandrew opened this issue Mar 20, 2018 · 1 comment
Closed

geom_hex ignores size aesthetic/parameter #2488

econandrew opened this issue Mar 20, 2018 · 1 comment
Labels
feature a feature request or enhancement good first issue ❤️ good issue for first-time contributors help wanted ❤️ we'd love your help! layers 📈

Comments

@econandrew
Copy link
Contributor

geom_hex defines a size default of 0.5, which by analogy with other filled geoms I would expect to control line weight (e.g. geom_bin2d, see bottom).

But it never gets passed to hexGrob so there is no change in the output size.

There's also an interesting inconsistency which may or may not be issue-worthy: geom_hex claims size as an aesthetic (in docs), whereas geom_bin2d does not, and for geom_bin2d size does indeed not work as an a aesthetic, only as a parameter, it seems.

library(ggplot2)
p <- ggplot(diamonds, aes(carat, price))

# This doesn't work as expected
p + geom_hex(size = 0.1, color = "red")

p + geom_hex(size = 2, color = "red")

p + geom_hex(aes(size = cut), color = "red")
#> Warning: Using size for a discrete variable is not advised.

# This does work as expected
p + geom_bin2d(size = 0.1, color = "red")

p + geom_bin2d(size = 2, color = "red")

@hadley hadley added feature a feature request or enhancement layers 📈 good first issue ❤️ good issue for first-time contributors help wanted ❤️ we'd love your help! labels Apr 27, 2018
hadley pushed a commit that referenced this issue Jul 9, 2018
* Support size and linetype in geom_hex (#2488)

* Add unit test for geom_hex size and linetype

* Update NEWS with new geom_hex() aesthetics
@lock
Copy link

lock bot commented Jan 5, 2019

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Jan 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature a feature request or enhancement good first issue ❤️ good issue for first-time contributors help wanted ❤️ we'd love your help! layers 📈
Projects
None yet
Development

No branches or pull requests

2 participants