7

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, e.g., boxwex or outpch; these are passed to bxp (if plot is true)..."

Ziad Salem
  • 496
  • 13
  • 34
N Brouwer
  • 4,778
  • 7
  • 30
  • 35
  • If you were asking how to pass something to 'pars' to affect the features of the "boxes" inside the plot area it could be as a 'named list': `boxplot(rnorm(100,50,10), horizontal = TRUE, notch = TRUE, pars=list( boxlwd = 4))` , .... but you made the question more general to apply to either `plot` or `boxplot`. – IRTFM Sep 18 '12 at 22:24

2 Answers2

9

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

boxplot(rnorm(100,50,10), horizontal = TRUE, notch = TRUE, boxlwd = 4)
Gavin Simpson
  • 170,508
  • 25
  • 396
  • 453
4

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

 box(lwd=5)
IRTFM
  • 258,963
  • 21
  • 364
  • 487
  • 1
    Or if they mean the lines of the boxes themselves, `boxlwd`, as clearly stated in `?bxp` which is linked to from `?boxplot`. – joran Sep 18 '12 at 22:08
  • Since he was already asking about `pars` parameters and that parameter is not particularly common for passing arguments to par(), I figured it needed to be more obscure. – IRTFM Sep 18 '12 at 22:18
  • No, no particular interest in pars; that was just my initial guess based on the help file. Thanks for the help. – N Brouwer Sep 19 '12 at 03:01