Skip to content

Whiskers and outliers for geom_boxplot with transformed scale #3336

Closed
@mbertolacci

Description

@mbertolacci

Boxplot whiskers and outliers seem to be incorrect when using geom_boxplot with a transformed scale. It probably affects notches too, but I haven't checked.

The hinges are fine, which makes sense—monotonic transformations preserve quantiles.

library(ggplot2)
df <- data.frame(x = 1, y = c(1, 4, 5, 6, 9))
print(ggplot(df, aes(x, y)) + geom_boxplot())

print(ggplot(df, aes(x, y)) + geom_boxplot() + scale_y_sqrt())

Created on 2019-05-20 by the reprex package (v0.3.0)

I'm using ggplot2 3.1.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorlayers 📈

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions