Re: [R] Plotting barplot and scatterplot on same device - x-axis problem

From: Jim Lemon <>
Date: Fri, 20 Jun 2008 23:16:41 +1000

On Fri, 2008-06-20 at 01:39 -0700, Thomas Pedersen wrote:
> Hi R-users
> I'm a relative newbie and uses R mostly for graphical purpose. I have a
> layout problem when plotting a scatterplot and a barplot using
> par(new=TRUE). The baseline of the x-axis is not positioned equal for the
> two plotting functions (see picture) and I have been unable to find out how
> this is changed.

Hi Thomas,
You might find that "barp" in the plotrix package will do what you want as it centers the bars on integral values.

Jim mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Fri 20 Jun 2008 - 16:03:25 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 20 Jun 2008 - 16:30:46 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive