It is not a bug: please read the help file
xpd: logical. Should bars be allowed to go outside region?
and note that the default is TRUE.
On Fri, 31 Mar 2006, michael.watson at bbsrc.ac.uk wrote:
> There seems to be a bug in barplot(). It occurs when specifying the
> ylim argument. It's best shown by example:
>
> dat <- matrix(c(1,1,1,2,2,2,3,3,3),ncol=3)
> barplot(dat, beside=TRUE)
> X11()
> barplot(dat, beside=TRUE, ylim=c(1,3))
>
> As can be seem, drawing of the graph seems to discount the margins of
> the plot.
As documented.
> I'm using R 2.2.1 on Windows
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595