Coloring boxplot outlier points in ggplot2?

后端 未结 6 898
挽巷
挽巷 2020-12-05 11:18

How can I color the outlier points in ggplot2? I want them to be the same color as the boxplot itself. colour= is not enough to do this.

Example:

<
6条回答
  •  时光取名叫无心
    2020-12-05 12:00

    The outliers automatically inherits the colours from the box again in ggplot2 * 1.0.1.9003.

    https://github.com/hadley/ggplot2/issues/1400

    ```{r}
    library(ggplot2)
    point_size=10
    ggplot(mtcars, aes(x=factor(cyl), y=mpg, col=factor(cyl))) +
    geom_boxplot(outlier.size = point_size)
    ```
    

    Boxplot

提交回复
热议问题