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

Rui Barradas ruipbarradas at sapo.pt
Sat Sep 29 21:59:30 CEST 2012


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:
> On Sep 29, 2012, at 10:23 AM, Meredith Ballard LaBeau wrote:
>
>> Good Afternoon-
>>   I was wanting to alter the boxplot to remove the lower whisker, both the
>> whisker line and staple just on the lower end. Is there a way to do this?
>> As my code is currently:
>> boxplot(log_loads~ind,data=nfmaum, horizontal=TRUE, notch=T, outline=FALSE,
>> whisker=0, main="Maumee River Near Future Climate Scenarios", ylab="Log
>> Load",xlab="Climate Scenarios")
> 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.
>
>
>> I just want to better see the medians and high end tail.
>>
>>




More information about the R-help mailing list