Rainer M Krug
2015-Feb-13 10:53 UTC
[R] [BUG] or [undocumented] boxplot - horizontal swaps ylim and xlim
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: --8<---------------cut here---------------start------------->8--- x <- runif(1000) boxplot(x) boxplot( x, ylim = c(0.2, 0.8) ) boxplot( x, ylim = c(0.2, 0.8), horizontal=TRUE ) --8<---------------cut here---------------end--------------->8--- This is either a bug or undocumented. Cheers, Rainer -- Rainer M. Krug email: Rainer<at>krugs<dot>de PGP: 0x0F52F982 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 494 bytes Desc: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20150213/cadfcc43/attachment.bin>
S Ellison
2015-Feb-13 13:30 UTC
[R] [BUG] or [undocumented] boxplot - horizontal swaps ylim and xlim
> 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'," S Ellison ******************************************************************* This email and any attachments are confidential. Any use...{{dropped:8}}
Rainer M Krug
2015-Feb-13 14:03 UTC
[R] [BUG] or [undocumented] boxplot - horizontal swaps ylim and xlim
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}}