Skip to content

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

@luke-a

Description

@luke-a

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions