Skip to content
Prev 305495 / 398506 Next

Boxplot lattice vs standard graphics

Thanks for the example. Makes it easy to see what you mean.

Yes, if I understand you correctly, you are right:
boxplot() (base) transforms the axes, so ?boxplot.stats, which is the
function that essentially computes the boxplot, does so on the
original data.
bwplot(lattice) transforms the data first, as the documentation for
the "log" component of the scales list makes clear, and **then** calls
boxplot.stats.

Although I think the latter makes more sense then the former, I think
the way to do it is to modify the "stats" function in an explicit call
to panel.bwplot to something like (UNTESTED!)
mystats <- function(x){
out <- boxplot.stats(10^x)
out$stats <- log10(out$stats)
out$conf <- log10(out$conf) ## Omit if you don't want notches
out$out <- log10(out$out)
out ## With the boxplot statistics converted to the log10 scale
}

I leave it to you to test and modify as necessary.

Cheers,
Bert
On Fri, Sep 14, 2012 at 2:37 AM, maxbre <mbressan at arpa.veneto.it> wrote: