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

2008-06-20 Thread Thomas Pedersen
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

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

2008-06-20 Thread stephen sefick
Is there anyway you could include the data so we can see what the problem is- I am getting better at this code reading stuff, but it reduces my time if I can just copy it into my R session and then fiddle. thanks Stephen On Fri, Jun 20, 2008 at 4:39 AM, Thomas Pedersen [EMAIL PROTECTED] wrote:

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

2008-06-20 Thread Jim Lemon
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

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

2008-06-20 Thread Thomas Pedersen
Of course :) - here you go... http://www.nabble.com/file/p18028420/Data.txt Data.txt The data is tab-separated Thanks for the reply -- View this message in context: http://www.nabble.com/Plotting-barplot-and-scatterplot-on-same-device---x-axis-problem-tp18025066p18028420.html Sent from the

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

2008-06-20 Thread Carl Witthoft
As an alternative to the other suggestions, I've found it just as easy to make the bar plot using plot() . Assuming I've run hist()-sudh, then do plot(sudh$breaks[1:length(sudh$breaks)-1],sudh$counts,type='h',lwd={pick_a_width_you_like)) Then it's easy to drop some scatterplot points or lines

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

2008-06-20 Thread Francisco J. Zagmutt
You could try using the arguments type, lwd and lend in the call to plot(). For example: plot(1:10, type=h, lend=2, lwd=10) points((1:10)*1.1, type=b) type=h creates vertical lines under each observation, lwd controls the thickness of the lines, and lend=2 draws square ends on the lines. I