Skip to content

Removing lower whisker in boxplot to see the effects of the high values

3 messages · Meredith Ballard LaBeau, David Winsemius, Rui Barradas

#
On Sep 29, 2012, at 10:23 AM, Meredith Ballard LaBeau wrote:

            
If you altered the value in what is passed from `boxplot.stats` to `bxp` so the lower whisker value was the same as the lower hinge value The lower whisker would merge into the hinge. `boxplot` returns those stats-values invisibly, so you just assign to an object name, make your changes and pass back to bxp.
#
Hello,

Note that some graphics parameters of boxplot and bxp are not the same. 
For instance 'col' becomes 'boxfill'.

boxp <- function(x, ...){
     bp <- boxplot(x, ..., plot = FALSE)
     bp$stats[1, ] <- bp$stats[2, ]
     bxp(bp, ...)
}

x <- rnorm(1000)

boxplot(x, col ="blue", notch = TRUE) # Can also be 'boxfill'
boxp(x, col ="blue", notch = TRUE)  # Must be 'boxfill'
boxp(x, boxfill ="blue", notch = TRUE)

Hope this helps,

Rui Barradas
Em 29-09-2012 18:46, David Winsemius escreveu: