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_hex ignores size aesthetic/parameter #2488

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

Comments

@econandrew
Copy link
Contributor

@econandrew econandrew commented Mar 20, 2018

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")

mikmart pushed a commit to mikmart/ggplot2 that referenced this issue May 29, 2018
mikmart pushed a commit to mikmart/ggplot2 that referenced this issue May 29, 2018
mikmart added a commit to mikmart/ggplot2 that referenced this issue Jul 9, 2018
mikmart added a commit to mikmart/ggplot2 that referenced this issue Jul 9, 2018
mikmart added a commit to mikmart/ggplot2 that referenced this issue Jul 9, 2018
@hadley hadley closed this in #2670 Jul 9, 2018
hadley added 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 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.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants