[R] [BUG] or [undocumented] boxplot - horizontal swaps ylim and xlim

Rainer M Krug Rainer at krugs.de
Fri Feb 13 15:03:30 CET 2015


S Ellison <S.Ellison at LGCGroup.com> writes:

>> When using the function boxplot() together with the argument
>> | horizontal = TRUE
>> xlim and ylim become swapped, i.e. ylim refers to the x-axis instead of the y-
>> axis:
>
> It is neither a bug nor undocumented, though the documentation is a
> not in ?boxplot (because xlim and ylim aren't defined there) and is
> also tad unclear in the present version.
>
> For boxplot and its methods, xlim and ylim fall into '...', which is
> (as documented) passed to bxp (see boxplot.default).
> ?bxp, says:
>
> "pars,...: graphical parameters (etc) can be passed as arguments to this
>           function, either as a list ('pars') or normally('...'), see
>           the following.  (Those in '...' take precedence over those in
>           'pars'.)
>
>           Currently, 'yaxs' and 'ylim' are used 'along the boxplot',
>           i.e., vertically, when 'horizontal' is false, and 'xlim'
>           horizontally.  'xaxt', 'yaxt', 'las', 'cex.axis', and
>           'col.axis' are passed to 'axis', and 'main', 'cex.main',
>           'col.main', 'sub', 'cex.sub', 'col.sub', 'xlab', 'ylab',
>           'cex.lab', and 'col.lab' are passed to 'title'."
>
> The key phrase is "Currently, 'yaxs' and 'ylim' are used 'along the boxplot',"     

Thanks for clarifying this.

I think this should be mentioned in boxplot as well.

Cheers,

Rainer

>
> S Ellison
>
>
>
> *******************************************************************
> This email and any attachments are confidential. Any u...{{dropped:24}}


More information about the R-help mailing list