How to change boxplot border color?

I would like to create boxplot as follows: enter image description here

This graph is created by bwplot in the lattice package. Instead of using this function, I hope to use boxplot to create a similar thing.

I noticed that in boxplot we can change the color of the box body, how can I change the border color of the window with the boxplot function? Thank!

+5
source share
1 answer

Look ?boxplotto find that there is an argument border=that does what you want. For instance:

boxplot(count ~ spray, data = InsectSprays, col = "lightgray",
        border=c("blue", "green", "blue", "green", "blue", "green"))

enter image description here

+9
source

All Articles