简体   繁体   中英

How to Increase the thickness of the box lines in an R boxplot?

How can I increase the thickness of the lines that outline "box" part of a boxplot using either the base R plot or boxplot function? That is, how do I thicken the lines of the box that defines the quantiles.

For a plot like this:

boxplot(rnorm(100,50,10), horizontal = TRUE, notch = TRUE)

I'm guessing I need to include a pars = statement like

boxplot(rnorm(100,50,10), horizontal = TRUE, notch = TRUE, pars = ...)

EDIT: My guess regarding the use of pars = comes from a first glance at the documentation for boxplot which indicates that pars = can call "a list of (potentially many) more graphical parameters, eg, boxwex or outpch; these are passed to bxp (if plot is true)..."

See the boxlwd parameter as discussed in ?bxp (linked to from ?boxplot ). Eg

boxplot(rnorm(100,50,10), horizontal = TRUE, notch = TRUE, boxlwd = 4)

Are you talking about the rectangle that surrounds the plot area? If so, then this can follow you plot call:

 box(lwd=5)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM