Skip to content

geom_boxplot outliers #4892

Closed
Closed

Description

@ggrothendieck

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)

Activity

  1. added
    feature
    on Jan 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurelayers 📈

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions