[R] ylim in barplot2 function?
marc_schwartz at comcast.net
Wed Oct 31 14:34:59 CET 2007
On Wed, 2007-10-31 at 11:52 +0100, Dieter Vanderelst wrote:
> Hi list,
> I'm using barplot2 form the gplots package to plot a few numbers (I
> want to add SD bars later).
> However, I would like the y-axis not to start from 0 but 500. When I
> add the parameters YLIM, something goes wrong. The graph is not 'cut
> off' at 500. Instead the bars seems to sink trough the bottom of the
> Because its a little hard to explain, here is a self-containing
> Does anybody know of a solution?
The behavior here is the same for both barplot() and barplot2(). You
need to set par("xpd") to FALSE, so that the bars are clipped to the
xpd = FALSE)
That being said, this is a bad idea in general, as you impact the
ability to visually discern the relative difference (or lack of it) in
the bars. You would be better off using a dotplot.
More information about the R-help