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_boxplot outliers #4892

Closed
ggrothendieck opened this issue Jun 27, 2022 · 0 comments · Fixed by #5379
Closed

geom_boxplot outliers #4892

ggrothendieck opened this issue Jun 27, 2022 · 0 comments · Fixed by #5379
Labels
feature a feature request or enhancement layers 📈

Comments

@ggrothendieck
Copy link

ggrothendieck commented Jun 27, 2022

An easier way to remove outliers and expand the boxplots to fill the graph would be nice.

This does work but I would have thought that there would be some less manual way of doing it.

library(ggplot2)
xlim_ <- range(boxplot.stats(mpg$hwy)$stats)
ggplot(mpg, aes(hwy, class)) +
  geom_boxplot(outlier.shape = NA) +
  xlim(xlim_)
#> Warning: Removed 3 rows containing non-finite values (`stat_boxplot()`).

In classical graphics outline=FALSE will both omit outliers and cause boxes to fill the graph.

boxplot(hwy ~ class, mpg, outline = FALSE, horizontal = TRUE)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement layers 📈
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants