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

Documentation of geom_boxplot: How does the weight aesthetic work? #1893

Closed
luke-a opened this Issue Nov 5, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@luke-a

luke-a commented Nov 5, 2016

I did not find anything on how the weight aesthetic in geom_boxplot / stat_boxplot is working. Is it missing? Or did I look at the wrong place?

library(ggplot2)
library(gridExtra)
grid.arrange(
  p1 <- ggplot(mpg, aes(class, hwy)) + geom_boxplot(),
  p2 <- ggplot(mpg, aes(class, hwy)) + geom_boxplot(aes(weight=displ))
)
cbind(ggplot_build(p1)$data[[1]][,"middle"], ggplot_build(p2)$data[[1]][,"middle"])
@hadley

This comment has been minimized.

Member

hadley commented Nov 7, 2016

It weights the computation of the quantiles.

@luke-a

This comment has been minimized.

luke-a commented Nov 17, 2016

Thanks

@luke-a luke-a closed this Nov 17, 2016

@JackWzh

This comment has been minimized.

JackWzh commented Apr 28, 2017

@hadley I read several plot codes with the weight aesthetic, but I still couldn't figure out how this aesthetic works exactly. So could you explain it more specifically or point where the weight aesthetic's source code lies? Thx : )

@lock lock bot locked as resolved and limited conversation to collaborators Jun 19, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.